From 317676d8687b2b658a89199298aa0f74eab31185 Mon Sep 17 00:00:00 2001 From: uz Date: Fri, 5 Aug 2011 12:09:11 +0000 Subject: [PATCH] Output module info. git-svn-id: svn://svn.cc65.org/cc65/trunk@5120 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ld65/dbgfile.c | 30 ++++++++++++++++++++++++++++++ src/ld65/scopes.c | 3 ++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/ld65/dbgfile.c b/src/ld65/dbgfile.c index 1b369169c..4aa64c953 100644 --- a/src/ld65/dbgfile.c +++ b/src/ld65/dbgfile.c @@ -58,6 +58,8 @@ void CreateDbgFile (void) /* Create a debug info file */ { + unsigned I; + /* Open the debug info file */ FILE* F = fopen (DbgFileName, "w"); if (F == 0) { @@ -67,6 +69,34 @@ void CreateDbgFile (void) /* Output version information */ fprintf (F, "version\tmajor=1,minor=2\n"); + /* Output modules */ + for (I = 0; I < CollCount (&ObjDataList); ++I) { + + /* Get this object file */ + const ObjData* O = CollConstAt (&ObjDataList, I); + + /* The main source file is the one at index zero */ + const FileInfo* Source = CollConstAt (&O->Files, 0); + + /* Output the module line */ + fprintf (F, + "module\tid=%u,name=\"%s\",file=%u", + I, + GetObjFileName (O), + Source->Id); + + /* Add library if any */ + if (O->LibName != INVALID_STRING_ID) { + fprintf (F, + ",lib=\"%s\",mtime=0x%08lX", + GetString (O->LibName), + O->MTime); + } + + /* Terminate the output line */ + fputc ('\n', F); + } + /* Output the segment info */ PrintDbgSegments (F); diff --git a/src/ld65/scopes.c b/src/ld65/scopes.c index 93e3d6b0d..561a555de 100644 --- a/src/ld65/scopes.c +++ b/src/ld65/scopes.c @@ -111,9 +111,10 @@ void PrintDbgScopes (FILE* F) const Scope* S = CollConstAt (&O->Scopes, J); fprintf (F, - "scope\tid=%u,name=\"%s\",type=%u", + "scope\tid=%u,name=\"%s\",module=%u,type=%u", BaseId + S->Id, GetString (S->Name), + I, S->Type); /* Print the size if available */ -- 2.39.5