]> git.sur5r.net Git - cc65/blobdiff - src/ld65/objfile.c
Added dbg file generation
[cc65] / src / ld65 / objfile.c
index f08b147617cff948fcff7838a300271c964f47cb..7eabc472ed334c4b8c1fcf2fc51746a162214b7d 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                          */
 /*                                                                          */
 /*                                                                          */
-/* (C) 1998    Ullrich von Bassewitz                                        */
-/*             Wacholderweg 14                                              */
-/*             D-70597 Stuttgart                                            */
-/* EMail:      uz@musoftware.de                                             */
+/* (C) 1998-2001 Ullrich von Bassewitz                                       */
+/*               Wacholderweg 14                                             */
+/*               D-70597 Stuttgart                                           */
+/* EMail:        uz@cc65.org                                                 */
 /*                                                                          */
 /*                                                                          */
 /* This software is provided 'as-is', without any expressed or implied      */
@@ -46,6 +46,7 @@
 #include "dbgsyms.h"
 #include "error.h"
 #include "exports.h"
+#include "fileinfo.h"
 #include "fileio.h"
 #include "lineinfo.h"
 #include "objdata.h"
@@ -112,13 +113,9 @@ void ObjReadFiles (FILE* F, ObjData* O)
     unsigned I;
 
     O->FileCount  = ReadVar (F);
-    O->Files      = xmalloc (O->FileCount * sizeof (char*));
+    O->Files      = xmalloc (O->FileCount * sizeof (FileInfo*));
     for (I = 0; I < O->FileCount; ++I) {
-               /* Skip MTime and size */
-               Read32 (F);
-               Read32 (F);
-               /* Read the filename */
-               O->Files [I] = ReadStr (F);
+               O->Files[I] = ReadFileInfo (F, O);
     }
 }
 
@@ -158,7 +155,7 @@ void ObjReadDbgSyms (FILE* F, ObjData* O)
 /* Read the debug symbols from a file at the current position */
 {
     unsigned I;
-                    
+
     O->DbgSymCount = ReadVar (F);
     O->DbgSyms    = xmalloc (O->DbgSymCount * sizeof (DbgSym*));
     for (I = 0; I < O->DbgSymCount; ++I) {
@@ -209,8 +206,8 @@ void ObjAdd (FILE* Obj, const char* Name)
     ObjReadHeader (Obj, &O->Header, Name);
 
     /* Initialize the object module data structure */
-    O->Name              = xstrdup (GetModule (Name));
-    O->Flags             = OBJ_HAVEDATA;
+    O->Name  = xstrdup (GetModule (Name));
+    O->Flags = OBJ_HAVEDATA;
 
     /* Read the files list from the object file */
     fseek (Obj, O->Header.FileOffs, SEEK_SET);