Exemple #1
0
void DwarfP1ModuleFinished( mod_entry *mod )
/*************************************************/
{
    if( MOD_NOT_DEBUGGABLE( mod ) )
        return;
    CurrMod = mod;
    if( mod->modinfo & MOD_DBI_SEEN )
        return;
    DBILineWalk( mod->lines, DwarfAddLines );
    Ring2Walk( mod->publist, DBIModGlobal );
    if( FmtData.type & MK_SEGMENTED ) {
        SectionTable[SECT_DEBUG_ABBREV].size = sizeof( SegmentedStandardAbbrevs );
    } else {
        SectionTable[SECT_DEBUG_ABBREV].size = sizeof( FlatStandardAbbrevs );
    }
    /* add length of compile unit header, abrrev code, module name, producer, stmts offset and reserve one byte for end */
    mod->d.d->pubsym.u.vm_offs = SectionTable[SECT_DEBUG_INFO].size;
    mod->d.d->pubsym.size += sizeof( compuhdr_prologue ) + sizeof( unsigned_8 ) + strlen( mod->name ) + 1 + sizeof( WLINK_PRODUCER ) + 1;
    if( mod->d.d->dasi.size > 0 )
        mod->d.d->pubsym.size += sizeof( unsigned_32 ); // DW_AT_STMT_LIST
    SectionTable[SECT_DEBUG_INFO].size += mod->d.d->pubsym.size;
    /* add length of lines info */
    if( mod->d.d->dasi.size > 0 ) {
        mod->d.d->dasi.u.vm_offs = SectionTable[SECT_DEBUG_LINE].size;
        mod->d.d->dasi.size += GetStmtHeaderSize( mod );
        SectionTable[SECT_DEBUG_LINE].size += mod->d.d->dasi.size;
    }
}
Exemple #2
0
static void WriteQNXGroup( group_entry *grp, unsigned_32 *segments )
/******************************************************************/
{
    segment     seg;

    seg = QNX_SEL_NUM( grp->grp_addr.seg );
    segments[seg] = grp->totalsize | ((unsigned_32)grp->u.qnxflags << 28);
    if( StackSegPtr != NULL && grp == StackSegPtr->group ) {
        segments[seg] -= StackSize;      // stack size gets
    }                                    // added on by QNX loader.
    if( grp->size == 0 ) return;
    AmountWritten = 0;
    CurrGroup = grp;
    WriteLoadRec();
    Ring2Walk( grp->leaders, DoGroupLeader );
}
Exemple #3
0
static void PrepModEntry( void *_mod, void *info )
/************************************************/
{
    mod_entry *mod = _mod;

    if( mod->modinfo & MOD_IS_FREE ) {
        *((unsigned_32 *)mod) = CARVE_INVALID_INDEX;
        return;
    }
    Ring2Walk( mod->publist, FixSymAddr );
    mod->n.next_mod = CarveGetIndex( CarveModEntry, mod->n.next_mod );
    mod->name = GetString( info, mod->name );
    mod->publist = CarveGetIndex( CarveSymbol, mod->publist );
    mod->segs = CarveGetIndex( CarveSegData, mod->segs );
    mod->modinfo &= ~MOD_CLEAR_ON_INC;
    if( mod->f.source != NULL ) {
        mod->f.fname = mod->f.source->file->name;
    }
}
Exemple #4
0
void CVP1ModuleFinished( mod_entry *obj )
/**********************************************/
// calculate size of the sstModule
{
    byte        namelen;
    unsigned_32 temp;
    unsigned_32 size;

    if( MOD_NOT_DEBUGGABLE( obj ) )
        return;
    TempIndex++;
    CurrMod = obj;
    obj->d.cv->modidx = TempIndex;
    if( CurrMod->modinfo & DBI_LINE ) {
        DBILineWalk( obj->lines, CVAddLines );
    }
    Ring2Walk( obj->publist, DBIModGlobal );
    namelen = strlen( obj->name );
    //  required alignment ???
    size = sizeof( cv_sst_module ) + namelen + 1 - sizeof( cv_seginfo );
    size = ROUND_UP( size, 4 );
    SectAddrs[CVSECT_MODULE] += size;
    //  required alignment ???
    AddSubSection( TRUE );
    if( obj->d.cv->pubsize > 0 ) {
        AddSubSection( FALSE );
        SectAddrs[CVSECT_MISC] += sizeof( unsigned_32 );
        obj->d.cv->pubsize += sizeof( unsigned_32 );
    }
    if( obj->d.cv->numlines > 0 ) {
        AddSubSection( FALSE );
        temp = sizeof( cheesy_module_header );
        temp += ROUND_UP( sizeof( cheesy_file_table ) + namelen, 4 );
        temp += sizeof( cheesy_mapping_table );
        temp += ROUND_UP( obj->d.cv->numlines
                    * ( sizeof( unsigned_32 ) + sizeof( unsigned_16 ) ), 4 );
        SectAddrs[CVSECT_MISC] += temp;
    }
}
Exemple #5
0
void TraceSymList( symbol * sym )
/**************************************/
{
    Ring2Walk( sym, MarkSymTraced );
}
Exemple #6
0
static void FixModAltDefs( mod_entry *mod )
/*****************************************/
{
    Ring2Walk( mod->publist, SetAltDefData );
}
Exemple #7
0
static void KillSyms( mod_entry *mod )
/************************************/
{
    Ring2Walk( mod->publist, KillASym );
}