#include "lidefs.h"
#include "objdefs.h"
#include "optdefs.h"
+#include "scopedefs.h"
#include "segdefs.h"
#include "symdefs.h"
#include "xmalloc.h"
+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 */
{
/* 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));