]> git.sur5r.net Git - cc65/commitdiff
Output the scope type in readable format.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 31 Jul 2011 14:01:27 +0000 (14:01 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 31 Jul 2011 14:01:27 +0000 (14:01 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@5096 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/od65/dump.c

index e08818cb80c345ccf0be99ba1e327e3655a12fbe..1ce183474abf40931f78db29748842ea317ef1e1 100644 (file)
@@ -45,6 +45,7 @@
 #include "lidefs.h"
 #include "objdefs.h"
 #include "optdefs.h"
+#include "scopedefs.h"
 #include "segdefs.h"
 #include "symdefs.h"
 #include "xmalloc.h"
@@ -233,6 +234,23 @@ static const char* GetExportFlags (unsigned Flags, const unsigned char* ConDes)
 
 
 
+static const char* GetScopeType (unsigned Type)
+/* Return the name of a scope type */
+{
+    switch (Type) {
+        case SCOPETYPE_GLOBAL:  return "Global scope";
+        case SCOPETYPE_FILE:    return "File scope";
+        case SCOPETYPE_PROC:    return ".PROC";
+        case SCOPETYPE_SCOPE:   return ".SCOPE";
+        case SCOPETYPE_STRUCT:  return ".STRUCT";
+        case SCOPETYPE_ENUM:    return ".ENUM";
+        case SCOPETYPE_UNDEF:   return "Undefined";
+        default:                return "Unknown scope type";
+    }
+}
+
+
+
 void DumpObjHeader (FILE* F, unsigned long Offset)
 /* Dump the header of the given object file */
 {
@@ -806,12 +824,12 @@ void DumpObjScopes (FILE* F, unsigned long Offset)
        /* Print the header */
        printf ("    Index:%27u\n", I);
 
-       /* Print the data */
+               /* Print the data */
         printf ("      Id:%28lu\n",             ReadVar (F));
         printf ("      Parent id:%21lu\n",      ReadVar (F));
         printf ("      Lexical level:%17lu\n",  ReadVar (F));
         printf ("      Flags:%25lu\n",          ReadVar (F));
-        printf ("      Type:%26lu\n",           ReadVar (F));
+        printf ("      Type:%26s\n",            GetScopeType (ReadVar (F)));
 
         /* Resolve and print the name */
                Name = GetString (&StrPool, ReadVar (F));