Esempio n. 1
0
extern  void    DFObjFiniDbgInfo( offset codesize ) {
/******************************/
    segment_id      old;
    offset          here;
    back_handle     bck;

    if( _IsModel( DBG_LOCALS | DBG_TYPES ) ) {
        bck = Comp_High;
        if( bck != NULL ){
            old = SetOP( AskCodeSeg() );
            OutLabel( bck->lbl );
            SetOP( old );
            BEFreeBack( bck );
            Comp_High = NULL;
        }
        DWEndCompileUnit( Client );
        DWFini( Client );
        old = SetOP( UnitSize->segment );
        here = AskLocation();
        SetLocation( UnitSize->offset );
        DataLong( codesize );
        SetLocation( here );
        SetOP( old );
        FiniSegBck();
    }
}
Esempio n. 2
0
void    FiniLabels( int label_type ) {
//====================================

// Free specified class of labels.

    label_entry **owner;
    label_entry *curr;

    owner = (label_entry **)&LabelList;
    for(;;) {
        curr = *owner;
        if( curr == NULL ) break;
        if( ( curr->label & FORMAT_LABEL ) == label_type ) {
            if( ( CGFlags & CG_FATAL ) == 0 ) {
                if( curr->label & FORMAT_LABEL ) {
                    BEFiniBack( curr->handle );
                    BEFreeBack( curr->handle );
                } else {
                    InfoError( CP_ERROR, "unfreed label" );
                    BEFiniLabel( curr->handle );
                }
            }
            *owner = curr->link;
            FMemFree( curr );
        } else {
            owner = &curr->link;
        }
    }
}
Esempio n. 3
0
static  void    FiniLineSegBck( void ){
/**************************************/
    back_handle bck;

    bck = DwarfSegs[DW_DEBUG_LINE].bck;
    BEFreeBack( bck );
}
Esempio n. 4
0
extern void DFAbbrevRef( void ){
/******************************/
    back_handle bck;

    bck = BENewBack( NULL );
//  BackImpPtr( ABBREV_NAME, bck, 0 );
    BEFreeBack( bck );
}
Esempio n. 5
0
void CgBackFreeHandle(          // FREE A BACK HANDLE FOR A SYMBOL
    SYMBOL sym )                // - the symbol
{
    if( ( sym->flag2 & SF2_CG_HANDLE )
      &&( ! SymIsAnonymous( sym ) )
      &&( ! SymIsAutomatic( sym ) ) ) {     // - only because of RO,RW-DTORS
        sym->flag2 &= ~SF2_CG_HANDLE;
        BEFreeBack( (back_handle)sym->locn->u.cg_handle );
    }
}
Esempio n. 6
0
static  void    FiniSegBck( void ){
/**********************************/
    int         i;
    back_handle bck;

    for( i = DW_DEBUG_INFO; i < DW_DEBUG_MAX; ++i ){
        bck = DwarfSegs[i].bck;
        BEFreeBack( bck );
    }
}
Esempio n. 7
0
void FiniSegBacks( void )                                   /* 15-mar-92 */
{
    struct user_seg     *useg;
    SYM_ENTRY           sym;

    for( useg = UserSegments; useg; useg = useg->next ) {
        if( useg->sym_handle != 0 ) {
            SymGet( &sym, useg->sym_handle );
            BEFreeBack( sym.info.backinfo );
        }
    }
}
Esempio n. 8
0
extern  void    DFSegRange( void ) {
    /****************************/
    /* do arange for the current segment */
    back_handle bck;
    offset      off;
    offset      size;

    if( !_IsModel( DBG_LOCALS | DBG_TYPES ) )return;
    size = AskMaxSize();
    if( size > 0 ) {
        bck = MakeLabel();
        off = AskLocation();
        SetLocation( 0 );
        DataLabel( bck->lbl );
        SetLocation( off );
        ARange = bck;
        DWAddress( Client, size );
        BEFreeBack( bck );
    }
}
Esempio n. 9
0
void    FreeRtRtns( void ) {
//====================

// Free symbol table entries for run-time routines.

    int         rt_index;
    sym_id      sym;

    rt_index = 0;
    while( rt_index <= MAX_RT_INDEX ) {
        sym = RtnTab[ rt_index ].sym_ptr;
        if( sym != NULL ) {
            if( ( CGFlags & CG_FATAL ) == 0 ) {
                if( sym->u.ns.u3.address != NULL ) {
                    BEFreeBack( sym->u.ns.u3.address );
                }
            }
            STFree( sym );
            RtnTab[ rt_index ].sym_ptr = NULL;
        }
        rt_index++;
    }
}
Esempio n. 10
0
extern void     DFLineNum( cue_state *state, offset lc ){
/*******************************************************/
    char *fname;

    if( NeedBaseSet() ){
        back_handle bck;

        bck = MakeLabel();
        OutLabel( bck->lbl );
        DWLineAddr( Client, (dw_sym_handle)bck, lc );
#if _TARGET & ( _TARG_IAPX86 | _TARG_80386 )
        if( _IsntTargetModel( FLAT_MODEL ) ) {
            DWLineSeg( Client, (dw_sym_handle)bck );
        }
#endif
        BEFreeBack( bck );
    }
    if( state->fno != CurrFNo ){
        fname = SrcFNoFind( state->fno );
        DWSetFile( Client, fname );
        CurrFNo = state->fno;
    }
    DWLineNum( Client, DW_LN_STMT, state->line, state->col, lc );
}
Esempio n. 11
0
void    FreeInlinePragmas( void ) {
//===========================

// Free symbol table entries for run-time routines.

#if _CPU == 386 || _CPU == 8086
    int         index;
    sym_id      sym;

    if( !CreatedPragmas ) return;
    for( index = 0; index < MAX_IN_INDEX; index++ ) {
        sym = InlineTab[ index ].sym_ptr;
        if( sym != NULL ) {
            if( ( CGFlags & CG_FATAL ) == 0 ) {
                if( sym->u.ns.u3.address != NULL ) {
                    BEFreeBack( sym->u.ns.u3.address );
                }
            }
            STFree( sym );
            InlineTab[ index ].sym_ptr = NULL;
        }
    }
#endif
}
Esempio n. 12
0
extern  void    DFBegCCU( segment_id code, dw_sym_handle dbg_pch )
/****************************************************************/
// Call when codeseg hase been defined
{
    dw_cu_info      cu;
    back_handle     bck;
    segment_id      old;
    type_def        *tipe_addr;

    if( _IsntModel( DBG_LOCALS | DBG_TYPES ) ) {
        return;
    }
    if( CcuDef ) {
        cu.source_filename = FEAuxInfo( NULL, SOURCE_NAME );
        cu.directory = "";
        cu.dbg_pch = dbg_pch;
        cu.inc_list = NULL;
        cu.inc_list_len = 0;
        old = SetOP( code );
#if _TARGET & ( _TARG_IAPX86 | _TARG_80386 )
        if( _IsTargetModel( FLAT_MODEL ) ) {
            bck = MakeLabel();
            OutLabel( bck->lbl );
            Pc_Low = bck;
            Pc_High = MakeLabel();
            // Emitting DW_AT_low_pc and DW_AT_high_pc is valid *only* if the
            // compilation unit's code is in a single contiguous block (see
            // DWARF 2, section 3.1).
            // I don't know how to find out at the time of this call if there's
            // only one code segment or not, hence these attributes are always
            // disabled. The low/high pc attribs should probably be handled by
            // the linker.
            cu.flags = false;
            cu.segment_size = 0;
        } else {
            bck = NULL;
            cu.flags = false;
            Pc_Low = NULL;
            Pc_High = NULL;
            cu.segment_size = 2;
        }
#else
        bck = MakeLabel();
        OutLabel( bck->lbl );
        Pc_Low = bck;
        Pc_High = MakeLabel();
        cu.flags = true;
        cu.segment_size = 0;
#endif
        SetOP( old );
        Comp_High = Pc_High;
        tipe_addr = TypeAddress( TY_NEAR_POINTER );
        cu.offset_size = tipe_addr->length;
        switch( GetMemModel() ) {
            case 'h':
                cu.model = DW_MODEL_HUGE;
                break;
            case 'l':
                cu.model = DW_MODEL_LARGE;
                break;
            case 'f':
                cu.model = DW_MODEL_FLAT;
                break;
            case 's':
                cu.model = DW_MODEL_SMALL;
                break;
            default:
                cu.model = DW_MODEL_NONE;
                break;
        }
        DWBeginCompileUnit( Client, &cu );
        if( cu.flags ) {
            BEFreeBack( bck );
        }
    } else {
        CcuDef = true;
    }
}