]> git.sur5r.net Git - cc65/commitdiff
Changed format of debug info file
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 13 Dec 2003 19:55:22 +0000 (19:55 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 13 Dec 2003 19:55:22 +0000 (19:55 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2748 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ld65/dbgfile.c
src/ld65/dbginfo.c
src/ld65/dbgsyms.c
src/ld65/dbgsyms.h
src/ld65/mapfile.c
src/ld65/segments.c

index 9f2c20e3efd3cd94045941b669c82cb6a0a24495..b3c7e9fe948211833d5cef472603c0f385be15a9 100644 (file)
@@ -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);
 
index 5218091a66d6ee1773abc91c610ea721a5664fe5..c51977fb7009234cf15f3850909c5884ad05b5ae 100644 (file)
@@ -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 */
index 3cccc89f3dc565093c7f7a6aa52bd804cf2e6033..0ecb52a7cca9ac5ea1c92953528279aab86235d9 100644 (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                                                 */
 /*                                                                           */
@@ -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)
 
 
 
-                                     
+
index beee4ea008b97174fce3ec4121ecd380e9bc7f96..6a3e5cfa65cb0165b3650c15eef443de1e1226c9 100644 (file)
@@ -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 */
 
index 22c11d492971a9ef601152f977595f7b918f9170..05328d59201cccdfead29fbfd58377e958464f45 100644 (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);
 
index 8c8645a8d7425f7761b06860f0f9515a1e939398..1fb7fcbd792d16e58fc3e8dfcf57ff23338edb81 100644 (file)
@@ -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");