X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fld65%2Fmapfile.c;h=ff9c74f9865d0feadea18d5fb5ec3fe5d9676012;hb=dc207514ddc8236903b883c4e4cfaee62255c917;hp=8e3582dd1c9900506f43f9ab66e2ae2c19d7b211;hpb=53dd513176425872128ef26031d00952ef7a0628;p=cc65 diff --git a/src/ld65/mapfile.c b/src/ld65/mapfile.c index 8e3582dd1..ff9c74f98 100644 --- a/src/ld65/mapfile.c +++ b/src/ld65/mapfile.c @@ -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 */ @@ -41,6 +41,7 @@ #include "error.h" #include "objdata.h" #include "segments.h" +#include "dbginfo.h" #include "dbgsyms.h" #include "exports.h" #include "config.h" @@ -75,14 +76,14 @@ void CreateMapFile (void) /* We've linked this module */ if (O->LibName) { /* The file is from a library */ - fprintf (F, "%s(%s):\n", O->LibName, O->Name); + fprintf (F, "%s(%s):\n", O->LibName, GetObjFileName (O)); } else { - fprintf (F, "%s:\n", O->Name); + fprintf (F, "%s:\n", GetObjFileName (O)); } for (I = 0; I < O->SectionCount; ++I) { const Section* S = O->Sections [I]; /* Don't include zero sized sections if not explicitly - * requested + * requested */ if (VerboseMap || S->Size > 0) { fprintf (F, " %-15s Offs = %06lX Size = %06lX\n", @@ -124,7 +125,7 @@ void CreateLabelFile (void) { ObjData* O; - /* Open the map file */ + /* Open the label file */ FILE* F = fopen (LabelFileName, "w"); if (F == 0) { Error ("Cannot create label file `%s': %s", LabelFileName, strerror (errno)); @@ -168,3 +169,33 @@ void CreateLabelFile (void) +void CreateDbgFile (void) +/* Create a debug info file */ +{ + ObjData* O; + + /* Open the debug info file */ + FILE* F = fopen (DbgFileName, "w"); + if (F == 0) { + Error ("Cannot create label file `%s': %s", DbgFileName, strerror (errno)); + } + + /* Print line infos from all modules we have linked into the output file */ + O = ObjRoot; + while (O) { + if (O->Flags & OBJ_HAVEDATA) { + /* We've linked this module */ + PrintDbgInfo (O, F); + + } + O = O->Next; + } + + /* Close the file */ + if (fclose (F) != 0) { + Error ("Error closing map file `%s': %s", DbgFileName, strerror (errno)); + } +} + + +