From d62af9de8046d51a461d28d10098220049ea4755 Mon Sep 17 00:00:00 2001 From: uz Date: Tue, 17 Aug 2010 20:11:27 +0000 Subject: [PATCH] Debug symbolid for each symbol that goes into the debug symbol output. git-svn-id: svn://svn.cc65.org/cc65/trunk@4811 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ca65/symentry.c | 1 + src/ca65/symentry.h | 3 ++- src/ca65/symtab.c | 6 ++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ca65/symentry.c b/src/ca65/symentry.c index cc6bfff6c..0603f16b5 100644 --- a/src/ca65/symentry.c +++ b/src/ca65/symentry.c @@ -90,6 +90,7 @@ SymEntry* NewSymEntry (const StrBuf* Name, unsigned Flags) S->GuessedUse[I] = 0; } S->Flags = Flags; + S->DebugSymId = ~0U; S->ImportId = ~0U; S->Expr = 0; S->ExprRefs = AUTO_COLLECTION_INITIALIZER; diff --git a/src/ca65/symentry.h b/src/ca65/symentry.h index ffe08e41e..01a4af2fb 100644 --- a/src/ca65/symentry.h +++ b/src/ca65/symentry.h @@ -94,7 +94,8 @@ struct SymEntry { * addressing */ unsigned Flags; /* Symbol flags */ - unsigned ImportId; /* Id if imported symbol */ + unsigned DebugSymId; /* Debug symbol id */ + unsigned ImportId; /* Id of import if this is one */ struct ExprNode* Expr; /* Symbol expression */ Collection ExprRefs; /* Expressions using this symbol */ unsigned char ExportSize; /* Export address size */ diff --git a/src/ca65/symtab.c b/src/ca65/symtab.c index d87661a61..aed5c4a44 100644 --- a/src/ca65/symtab.c +++ b/src/ca65/symtab.c @@ -780,12 +780,12 @@ void WriteDbgSyms (void) /* Check if debug info is requested */ if (DbgSyms) { - /* Walk through the list and count the symbols */ + /* Walk through the list, give each symbol an id and count them */ Count = 0; S = SymList; while (S) { if ((S->Flags & SF_DBGINFOMASK) == SF_DBGINFOVAL) { - ++Count; + S->DebugSymId = Count++; } S = S->List; } @@ -856,5 +856,3 @@ void WriteScopes (void) - - -- 2.39.5