Rearrange debug info output. Add scopes to the debug info.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5117 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-08-04 15:58:54 +00:00
parent 871873b1ac
commit 2f75733e43
13 changed files with 164 additions and 220 deletions

View File

@@ -2,7 +2,7 @@
/* */
/* fileinfo.c */
/* */
/* sOURCE FILE INFO STRUCTURE */
/* Source file info structure */
/* */
/* */
/* */
@@ -40,6 +40,8 @@
/* ld65 */
#include "fileio.h"
#include "fileinfo.h"
#include "objdata.h"
#include "spool.h"
@@ -110,7 +112,7 @@ static FileInfo* NewFileInfo (void)
FileInfo* FI = xmalloc (sizeof (FileInfo));
/* Initialize stuff */
FI->Id = Id++;
FI->Id = Id++;
FI->Dumped = 0;
/* Return the new struct */
@@ -180,3 +182,29 @@ FileInfo* ReadFileInfo (FILE* F, ObjData* O)
void PrintDbgFileInfo (FILE* F)
/* Output the file info to a debug info file */
{
unsigned I, J;
/* Print file infos from all modules we have linked into the output file */
for (I = 0; I < CollCount (&ObjDataList); ++I) {
/* Get the object file */
ObjData* O = CollAtUnchecked (&ObjDataList, I);
/* Output the files section */
for (J = 0; J < CollCount (&O->Files); ++J) {
FileInfo* FI = CollAt (&O->Files, J);
if (!FI->Dumped) {
fprintf (F,
"file\tid=%u,name=\"%s\",size=%lu,mtime=0x%08lX\n",
FI->Id, GetString (FI->Name), FI->Size, FI->MTime);
FI->Dumped = 1;
}
}
}
}