Central management of the debug info base ids.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5123 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-08-05 13:09:13 +00:00
parent a87d8ec233
commit a17d11cba8
6 changed files with 60 additions and 25 deletions

View File

@@ -207,10 +207,9 @@ long GetDbgSymVal (const DbgSym* D)
void PrintDbgSyms (FILE* F)
/* Print the debug symbols in a debug file */
{
{
unsigned I, J;
unsigned BaseId = 0;
for (I = 0; I < CollCount (&ObjDataList); ++I) {
/* Get the object file */
@@ -230,12 +229,12 @@ void PrintDbgSyms (FILE* F)
/* Emit the base data for the entry */
fprintf (F,
"sym\tid=%u,name=\"%s\",value=0x%lX,addrsize=%s,type=%s",
BaseId + J,
"sym\tid=%u,name=\"%s\",val=0x%lX,addrsize=%s,type=%s",
O->SymBaseId + J,
GetString (S->Name),
Val,
AddrSizeToStr (S->AddrSize),
SYM_IS_LABEL (S->Type)? "label" : "equate");
SYM_IS_LABEL (S->Type)? "lab" : "equ");
/* Emit the size only if we know it */
if (S->Size != 0) {
@@ -247,24 +246,21 @@ void PrintDbgSyms (FILE* F)
*/
GetSegExprVal (S->Expr, &D);
if (!D.TooComplex && D.Seg != 0) {
fprintf (F, ",segment=%u", D.Seg->Id);
fprintf (F, ",seg=%u", D.Seg->Id);
}
/* For cheap local symbols, add the owner symbol, for others,
* add the owner scope.
*/
if (SYM_IS_STD (S->Type)) {
fprintf (F, ",scope=%u", S->OwnerId);
fprintf (F, ",scope=%u", O->ScopeBaseId + S->OwnerId);
} else {
fprintf (F, ",parent=%u", S->OwnerId);
fprintf (F, ",parent=%u", O->SymBaseId + S->OwnerId);
}
/* Terminate the output line */
fputc ('\n', F);
}
/* Increment base id */
BaseId += CollCount (&O->DbgSyms);
}
}