]> git.sur5r.net Git - cc65/commitdiff
Use symbolic names when writing the scope type to the debug info file.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 8 Aug 2011 21:07:45 +0000 (21:07 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 8 Aug 2011 21:07:45 +0000 (21:07 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@5139 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ld65/scopes.c

index 4f06b6d23411686bb61871a72d9e451df491ee5b..e548fcad5a630ec841bcf822cece38392b03518c 100644 (file)
@@ -100,7 +100,7 @@ Scope* ReadScope (FILE* F, ObjData* Obj, unsigned Id)
 
 unsigned ScopeCount (void)
 /* Return the total number of scopes */
-{              
+{
 
     /* Count scopes from all modules we have linked into the output file */
     unsigned I;
@@ -133,13 +133,26 @@ void PrintDbgScopes (FILE* F)
             const Scope* S = CollConstAt (&O->Scopes, J);
 
             fprintf (F,
-                     "scope\tid=%u,name=\"%s\",mod=%u,type=%u",
+                     "scope\tid=%u,name=\"%s\",mod=%u",
                      O->ScopeBaseId + S->Id,
                      GetString (S->Name),
-                     I,
-                     S->Type);
+                     I);
+
+            /* Print the type if not module */
+            switch (S->Type) {
+
+                case SCOPE_GLOBAL:      fputs (",type=global", F);      break;
+                case SCOPE_FILE:        /* default */                   break;
+                case SCOPE_SCOPE:       fputs (",type=scope", F);       break;
+                case SCOPE_STRUCT:      fputs (",type=struct", F);      break;
+                case SCOPE_ENUM:        fputs (",type=enum", F);        break;
+
+                default:
+                    Error ("Module `%s': Unknown scope type %u",
+                           GetObjFileName (O), S->Type);
+            }
 
-            /* Print the size if available */
+            /* Print the size if available */                 
             if (S->Size != 0) {
                 fprintf (F, ",size=%lu", S->Size);
             }