1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-11 05:29:33 +00:00

Output the scope type in readable format.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5096 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2011-07-31 14:01:27 +00:00
parent 4191eb7718
commit 8ec6f66bf0

View 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));