Exemplo n.º 1
0
static char *StrVal( char *which, brkp *wp, char *p )
{
    unsigned    max;

    for( *p++ = ' '; *which != NULLCHAR; *p++ = *which++ ) {}
    *p++ = '=';
    max = ~0;
    MADTypeHandleToString( CurrRadix, wp->th, &wp->item, p, &max );
    p += max;
    return( p );
}
Exemplo n.º 2
0
static const char *RegValueName( const void *data_handle, int item )
{
    mad_modify_list const *possible = (mad_modify_list const *)data_handle + item;
    size_t          buff_len;

    buff_len = TXT_LEN;
    if( possible->name == MAD_MSTR_NIL ) {
        MADTypeHandleToString( MADTypePreferredRadix( possible->type ),
                possible->type, possible->data, TxtBuff, &buff_len );
    } else {
        MADCliString( possible->name, TxtBuff, buff_len );
    }
    return( TxtBuff );
}
Exemplo n.º 3
0
static  bool    RegGetLine( a_window *wnd, int row, int piece,
                            wnd_line_piece *line )
{
    int                 column;
    int                 i;
    reg_window          *reg = WndReg( wnd );
    size_t              max = TXT_LEN;
    mad_radix           old_radix, new_radix;
    item_mach           value;
    reg_display_piece   disp;

    column = piece >> 1;
    if( column >= reg->up )
        return( false );
    i = GetRegIdx( reg, row, column );
    if( i >= reg->count )
        return( false );
    if( i == -1 )
        return( false );
    if( !GetDisplayPiece( &disp, reg, DbgRegs, i ) )
        return( false );
    line->text = TxtBuff;
    if( piece & 1 ) {
        line->indent = reg->indents[column].value;
        if( reg->info[i].info == NULL ) {
            strcpy( TxtBuff, "   " );
        } else {
            new_radix = MADTypePreferredRadix( disp.disp_type );
            old_radix = NewCurrRadix( new_radix );
            RegValue( &value, reg->info[i].info, DbgRegs );
            max = reg->info[i].max_value + 1;
            MADTypeHandleToString( new_radix, disp.disp_type, &value, TxtBuff, &max );
            NewCurrRadix( old_radix );
            reg->info[i].standout = false;
            if( MADRegModified( reg->data, reg->info[i].info, &PrevRegs->mr, &DbgRegs->mr ) == MS_MODIFIED_SIGNIFICANTLY ) {
                reg->info[i].standout = true;
                line->attr = WND_STANDOUT;
            }
        }
    } else {
        line->indent = reg->indents[column].descript;
        strcpy( TxtBuff, disp.descript );
        if( TxtBuff[0] != NULLCHAR ) {
            strcat( TxtBuff, ":" );
        }
        line->tabstop = false;
    }
    return( true );
}
Exemplo n.º 4
0
OVL_EXTERN  bool    IOGetLine( a_window wnd, wnd_row row, wnd_piece piece, wnd_line_piece *line )
{
    io_window   *io = WndIO( wnd );
//    bool        ret;
    io_location *curr;
    int         i;
    mad_radix   old_radix, new_radix;
    size_t      max;

    if( row >= io->num_rows )
        return( false );
    curr = &io->list[row];
//    ret = true;
    line->text = TxtBuff;
    switch( piece ) {
    case PIECE_READ:
        SetGadgetLine( wnd, line, GADGET_READ );
        return( true );
    case PIECE_WRITE:
        SetGadgetLine( wnd, line, GADGET_WRITE );
        line->indent = MaxGadgetLength;
        return( true );
    case PIECE_ADDRESS:
        AddrToIOString( &curr->addr, TxtBuff, TXT_LEN );
        line->indent = 2 * MaxGadgetLength;
        return( true );
    case PIECE_VALUE:
        new_radix = IOData.info[curr->type].piece_radix;
        old_radix = NewCurrRadix( new_radix );
        line->indent = 2 * MaxGadgetLength + 10 * WndMaxCharX( wnd );
        if( curr->value_known ) {
            max = TXT_LEN;
            MADTypeHandleToString( new_radix, IOData.info[curr->type].mth, &curr->value, TxtBuff, &max );
        } else {
            for( i = 0; i < IOData.info[curr->type].item_width; ++i ) {
                TxtBuff[i] = '?';
            }
            TxtBuff[i] = NULLCHAR;
        }
        NewCurrRadix( old_radix );
        return( true );
    default:
        return( false );
    }
}
Exemplo n.º 5
0
void GetBPText( brkp *bp, char *buff )
{
    unsigned    max;

    //MAD: might be a different mad then when break set
    max = ~0;
    if( IS_BP_EXECUTE( bp->th ) ) {
        if( bp->source_line != NULL ) {
            strcpy( buff, bp->source_line );
        } else {
            if( IS_NIL_ADDR( bp->loc.addr ) ) {
                strcpy( buff, LIT_ENG( Quest_Marks ) );
            } else {
                UnAsm( bp->loc.addr, buff, max );
            }
        }
    } else {
        MADTypeHandleToString( CurrRadix, bp->th, &bp->item, buff, &max );
    }
}
Exemplo n.º 6
0
static void getMadString( mad_reg_set_data *data, mad_registers *regs, int i,
    RegStringCreateData *create )
{
    mad_type_handle mtype;
    mad_type_info   mti;
    mad_radix       radix;
    const mad_reg_info    *rinfo;
    void            *value;
    unsigned        max_len;
    const char      *descript;

    MADRegSetDisplayGetPiece( data, regs, i, &descript, &( create[i].maxd ), &rinfo, &mtype, &( create[i].length ) );

    if ( create[i].maxd == 0 && descript != NULL ){
        create[i].maxd = strlen( descript );
    }
    if ( descript != NULL && IsEmptyString( descript ) == FALSE ){
        strcpy( create[i].buffer, descript );
        create[i].maxd ++;
    } else {
        create[i].buffer[0] = '\0';
        create[i].maxd = 0;
    }

    if( create[i].length == 0 && rinfo != NULL ) {
       create[i].length = getMADMaxFormatWidth(mtype);
    }

    if( rinfo != NULL ) {
        MADTypeInfo( rinfo->type, &mti );
        value = alloca( BITS2BYTES( mti.b.bits ) );
        BitGet( value, (unsigned char *)regs, rinfo->bit_start, rinfo->bit_size );
        radix = MADTypePreferredRadix( mtype );
        max_len = create[i].length + 1;
        MADTypeHandleToString( radix, mtype, value, create[i].value, &max_len );
    } else {
        create[i].value[0] = '\0';
    }
}