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; } }
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 ); }
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; } }
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; } }
void TraceSymList( symbol * sym ) /**************************************/ { Ring2Walk( sym, MarkSymTraced ); }
static void FixModAltDefs( mod_entry *mod ) /*****************************************/ { Ring2Walk( mod->publist, SetAltDefData ); }
static void KillSyms( mod_entry *mod ) /************************************/ { Ring2Walk( mod->publist, KillASym ); }