mirror of
https://github.com/cc65/cc65.git
synced 2024-11-18 15:05:14 +00:00
Changed format of debug info file
git-svn-id: svn://svn.cc65.org/cc65/trunk@2748 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
1b2c277f8b
commit
108134f43d
@ -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);
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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 <string.h>
|
||||
|
||||
/* 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)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user