From 108134f43dcb12c8456ebc0737a5abe3766bd3bc Mon Sep 17 00:00:00 2001 From: cuz Date: Sat, 13 Dec 2003 19:55:22 +0000 Subject: [PATCH] Changed format of debug info file git-svn-id: svn://svn.cc65.org/cc65/trunk@2748 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ld65/dbgfile.c | 5 ++++- src/ld65/dbginfo.c | 11 ++++++----- src/ld65/dbgsyms.c | 22 +++++++++------------- src/ld65/dbgsyms.h | 5 +++++ src/ld65/mapfile.c | 5 ++++- src/ld65/segments.c | 2 +- 6 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/ld65/dbgfile.c b/src/ld65/dbgfile.c index 9f2c20e3e..b3c7e9fe9 100644 --- a/src/ld65/dbgfile.c +++ b/src/ld65/dbgfile.c @@ -7,7 +7,7 @@ /* */ /* */ /* (C) 2003 Ullrich von Bassewitz */ -/* Römerstrasse 52 */ +/* Römerstraße 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ /* */ @@ -64,6 +64,9 @@ void CreateDbgFile (void) Error ("Cannot create debug file `%s': %s", DbgFileName, strerror (errno)); } + /* Clear the debug sym table (used to detect duplicates) */ + ClearDbgSymTable (); + /* Output the segment info */ PrintDbgSegments (F); diff --git a/src/ld65/dbginfo.c b/src/ld65/dbginfo.c index 5218091a6..c51977fb7 100644 --- a/src/ld65/dbginfo.c +++ b/src/ld65/dbginfo.c @@ -7,7 +7,7 @@ /* */ /* */ /* (C) 2001-2003 Ullrich von Bassewitz */ -/* Römerstrasse 52 */ +/* Römerstraße 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ /* */ @@ -55,11 +55,11 @@ void PrintDbgInfo (ObjData* O, FILE* F) /* Output the files section */ for (I = 0; I < O->FileCount; ++I) { const FileInfo* FI = O->Files[I]; - fprintf (F, "file\t\"%s\", %lu, %lu\n", + fprintf (F, "file\t\"%s\",size=%lu,mtime=0x%08lX\n", GetString (FI->Name), FI->Size, FI->MTime); } - /* Output the lines */ + /* Output the line infos */ for (I = 0; I < O->LineInfoCount; ++I) { /* Get this line info */ @@ -74,7 +74,8 @@ void PrintDbgInfo (ObjData* O, FILE* F) } /* Name and line number */ - fprintf (F, "line\t\"%s\", %lu", GetString (LI->File->Name), LI->Pos.Line); + fprintf (F, "line\t\"%s\",line=%lu", GetString (LI->File->Name), + LI->Pos.Line); /* Code ranges */ for (J = 0; J < CollCount (CodeRanges); ++J) { @@ -83,7 +84,7 @@ void PrintDbgInfo (ObjData* O, FILE* F) const CodeRange* R = CollConstAt (CodeRanges, J); /* Print it */ - fprintf (F, ", %06lX-%06lX", R->Offs, R->Offs + R->Size - 1); + fprintf (F, ",range=0x%06lX-0x%06lX", R->Offs, R->Offs + R->Size - 1); } /* Terminate the line */ diff --git a/src/ld65/dbgsyms.c b/src/ld65/dbgsyms.c index 3cccc89f3..0ecb52a7c 100644 --- a/src/ld65/dbgsyms.c +++ b/src/ld65/dbgsyms.c @@ -7,7 +7,7 @@ /* */ /* */ /* (C) 1998-2003 Ullrich von Bassewitz */ -/* Römerstrasse 52 */ +/* Römerstraße 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ /* */ @@ -36,6 +36,7 @@ #include /* common */ +#include "addrsize.h" #include "check.h" #include "symdefs.h" #include "xmalloc.h" @@ -98,9 +99,9 @@ static DbgSym* GetDbgSym (DbgSym* D, long Val) { /* Create the hash. We hash over the symbol value */ unsigned Hash = ((Val >> 24) & 0xFF) ^ - ((Val >> 16) & 0xFF) ^ - ((Val >> 8) & 0xFF) ^ - ((Val >> 0) & 0xFF); + ((Val >> 16) & 0xFF) ^ + ((Val >> 8) & 0xFF) ^ + ((Val >> 0) & 0xFF); /* Check for this symbol */ DbgSym* Sym = DbgSymPool[Hash]; @@ -166,7 +167,7 @@ DbgSym* ReadDbgSym (FILE* F, ObjData* O) -static void ClearDbgSymTable (void) +void ClearDbgSymTable (void) /* Clear the debug symbol table */ { unsigned I; @@ -197,9 +198,6 @@ void PrintDbgSyms (ObjData* O, FILE* F) { unsigned I; - /* Clear the debug sym table */ - ClearDbgSymTable (); - /* Walk through all debug symbols in this module */ for (I = 0; I < O->DbgSymCount; ++I) { @@ -219,9 +217,10 @@ void PrintDbgSyms (ObjData* O, FILE* F) /* Emit the debug file line */ fprintf (F, - "sym\t\"%s\", %08lX, %s\n", + "sym\t\"%s\",value=0x%08lX,addrsize=%s,type=%s\n", GetString (D->Name), Val, + AddrSizeToStr (D->AddrSize), IS_EXP_LABEL (D->Type)? "label" : "equate"); /* Insert the symbol into the table */ @@ -237,9 +236,6 @@ void PrintDbgSymLabels (ObjData* O, FILE* F) { unsigned I; - /* Clear the debug sym table */ - ClearDbgSymTable (); - /* Walk through all debug symbols in this module */ for (I = 0; I < O->DbgSymCount; ++I) { @@ -273,4 +269,4 @@ void PrintDbgSymLabels (ObjData* O, FILE* F) - + diff --git a/src/ld65/dbgsyms.h b/src/ld65/dbgsyms.h index beee4ea00..6a3e5cfa6 100644 --- a/src/ld65/dbgsyms.h +++ b/src/ld65/dbgsyms.h @@ -82,6 +82,11 @@ DbgSym* ReadDbgSym (FILE* F, ObjData* Obj); long GetDbgSymVal (DbgSym* D); /* Get the value of this symbol */ +void ClearDbgSymTable (void); +/* Clear the debug symbol table. Must be called before outputting debug syms + * or debug labels the first time. + */ + void PrintDbgSyms (ObjData* O, FILE* F); /* Print the debug symbols in a debug file */ diff --git a/src/ld65/mapfile.c b/src/ld65/mapfile.c index 22c11d492..05328d592 100644 --- a/src/ld65/mapfile.c +++ b/src/ld65/mapfile.c @@ -7,7 +7,7 @@ /* */ /* */ /* (C) 1998-2003 Ullrich von Bassewitz */ -/* Römerstrasse 52 */ +/* Römerstraße 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ /* */ @@ -133,6 +133,9 @@ void CreateLabelFile (void) Error ("Cannot create label file `%s': %s", LabelFileName, strerror (errno)); } + /* Clear the debug sym table (used to detect duplicates) */ + ClearDbgSymTable (); + /* Print the labels for the export symbols */ PrintExportLabels (F); diff --git a/src/ld65/segments.c b/src/ld65/segments.c index 8c8645a8d..1fb7fcbd7 100644 --- a/src/ld65/segments.c +++ b/src/ld65/segments.c @@ -635,7 +635,7 @@ void PrintDbgSegments (FILE* F) if (S->Size > 0) { /* Print the segment data */ - fprintf (F, "segment\t\"%s\", 0x%06lX, 0x%04lX, %s, %s\n", + fprintf (F, "segment\t\"%s\",start=0x%06lX,size=0x%04lX,addrsize=%s,type=%s\n", GetString (S->Name), S->PC, S->Size, AddrSizeToStr (S->AddrSize), S->ReadOnly? "ro" : "rw"); -- 2.39.5