mirror of
https://github.com/cc65/cc65.git
synced 2024-12-25 02:29:52 +00:00
Write the high level debug info to the object file.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5281 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
314476de27
commit
eee6068029
@ -45,7 +45,9 @@
|
||||
#include "error.h"
|
||||
#include "expr.h"
|
||||
#include "filetab.h"
|
||||
#include "global.h"
|
||||
#include "lineinfo.h"
|
||||
#include "objfile.h"
|
||||
#include "nexttok.h"
|
||||
#include "symtab.h"
|
||||
|
||||
@ -277,7 +279,7 @@ void DbgInfoSym (void)
|
||||
unsigned AsmName = EMPTY_STRING_ID;
|
||||
unsigned Flags;
|
||||
int Offs;
|
||||
HLDbgSym* S;
|
||||
HLDbgSym* S;
|
||||
|
||||
|
||||
/* Parameters are separated by a comma */
|
||||
@ -351,3 +353,39 @@ void DbgInfoSym (void)
|
||||
|
||||
|
||||
|
||||
void WriteHLDbgSyms (void)
|
||||
/* Write a list of all high level language symbols to the object file. */
|
||||
{
|
||||
unsigned I;
|
||||
|
||||
/* Only if debug info is enabled */
|
||||
if (DbgSyms) {
|
||||
|
||||
/* Write the symbol count to the list */
|
||||
ObjWriteVar (CollCount (&HLDbgSyms));
|
||||
|
||||
/* Walk through list and write all symbols to the file. */
|
||||
for (I = 0; I < CollCount (&HLDbgSyms); ++I) {
|
||||
|
||||
/* Get the next symbol */
|
||||
const HLDbgSym* S = CollAtUnchecked (&HLDbgSyms, I);
|
||||
|
||||
/* Write the symbol data */
|
||||
ObjWriteVar (S->Flags);
|
||||
ObjWriteVar (S->Name);
|
||||
ObjWriteVar (S->AsmName);
|
||||
ObjWriteVar (S->Offs);
|
||||
ObjWriteVar (S->Type);
|
||||
ObjWriteVar (S->ScopeId);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
/* Write a count of zero */
|
||||
ObjWriteVar (0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -56,6 +56,9 @@ void DbgInfoLine (void);
|
||||
void DbgInfoSym (void);
|
||||
/* Parse and handle SYM subcommand of the .dbg pseudo instruction */
|
||||
|
||||
void WriteHLDbgSyms (void);
|
||||
/* Write a list of all high level language symbols to the object file. */
|
||||
|
||||
|
||||
|
||||
/* End of dbginfo.h */
|
||||
|
@ -45,9 +45,10 @@
|
||||
#include "xmalloc.h"
|
||||
|
||||
/* ca65 */
|
||||
#include "global.h"
|
||||
#include "dbginfo.h"
|
||||
#include "error.h"
|
||||
#include "expr.h"
|
||||
#include "global.h"
|
||||
#include "objfile.h"
|
||||
#include "scanner.h"
|
||||
#include "segment.h"
|
||||
@ -909,6 +910,9 @@ void WriteDbgSyms (void)
|
||||
|
||||
}
|
||||
|
||||
/* Write the high level symbols */
|
||||
WriteHLDbgSyms ();
|
||||
|
||||
/* Done writing debug symbols */
|
||||
ObjEndDbgSyms ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user