1
0
mirror of https://github.com/cc65/cc65.git synced 2025-02-11 15:30:52 +00:00

Add a (currently empty) type string to the debug info for symbols and functions.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5274 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2011-08-26 13:01:29 +00:00
parent 2fbebd25cf
commit 6b8efa8e9b
2 changed files with 37 additions and 11 deletions

View File

@ -112,9 +112,10 @@ void DbgInfoFunc (void)
"STATIC", "STATIC",
}; };
StrBuf Name = STATIC_STRBUF_INITIALIZER; StrBuf Name = STATIC_STRBUF_INITIALIZER;
StrBuf AsmName = STATIC_STRBUF_INITIALIZER; StrBuf Type = STATIC_STRBUF_INITIALIZER;
int StorageClass; StrBuf AsmName = STATIC_STRBUF_INITIALIZER;
int StorageClass;
/* Parameters are separated by a comma */ /* Parameters are separated by a comma */
@ -131,6 +132,17 @@ void DbgInfoFunc (void)
/* Comma expected */ /* Comma expected */
ConsumeComma (); ConsumeComma ();
/* Type */
if (CurTok.Tok != TOK_STRCON) {
ErrorSkip ("String constant expected");
return;
}
SB_Copy (&Type, &CurTok.SVal);
NextTok ();
/* Comma expected */
ConsumeComma ();
/* The storage class follows */ /* The storage class follows */
if (CurTok.Tok != TOK_IDENT) { if (CurTok.Tok != TOK_IDENT) {
ErrorSkip ("Storage class specifier expected"); ErrorSkip ("Storage class specifier expected");
@ -156,6 +168,7 @@ void DbgInfoFunc (void)
/* Free memory used for the strings */ /* Free memory used for the strings */
SB_Done (&AsmName); SB_Done (&AsmName);
SB_Done (&Type);
SB_Done (&Name); SB_Done (&Name);
} }
@ -222,10 +235,11 @@ void DbgInfoSym (void)
"STATIC", "STATIC",
}; };
StrBuf Name = STATIC_STRBUF_INITIALIZER; StrBuf Name = STATIC_STRBUF_INITIALIZER;
StrBuf AsmName = STATIC_STRBUF_INITIALIZER; StrBuf Type = STATIC_STRBUF_INITIALIZER;
int StorageClass; StrBuf AsmName = STATIC_STRBUF_INITIALIZER;
int Offs; int StorageClass;
int Offs;
/* Parameters are separated by a comma */ /* Parameters are separated by a comma */
@ -242,6 +256,17 @@ void DbgInfoSym (void)
/* Comma expected */ /* Comma expected */
ConsumeComma (); ConsumeComma ();
/* Type */
if (CurTok.Tok != TOK_STRCON) {
ErrorSkip ("String constant expected");
return;
}
SB_Copy (&Type, &CurTok.SVal);
NextTok ();
/* Comma expected */
ConsumeComma ();
/* The storage class follows */ /* The storage class follows */
if (CurTok.Tok != TOK_IDENT) { if (CurTok.Tok != TOK_IDENT) {
ErrorSkip ("Storage class specifier expected"); ErrorSkip ("Storage class specifier expected");
@ -276,6 +301,7 @@ void DbgInfoSym (void)
/* Free memory used for the strings */ /* Free memory used for the strings */
SB_Done (&AsmName); SB_Done (&AsmName);
SB_Done (&Type);
SB_Done (&Name); SB_Done (&Name);
} }

View File

@ -368,7 +368,7 @@ static void EmitDebugInfo (void)
const SymTable* Tab = Desc->SymTab; const SymTable* Tab = Desc->SymTab;
/* Output info for the function itself */ /* Output info for the function itself */
AddTextLine ("\t.dbg\tfunc, \"%s\", %s, \"%s\"", AddTextLine ("\t.dbg\tfunc, \"%s\", \"\", %s, \"%s\"",
Sym->Name, Sym->Name,
(Sym->Flags & SC_EXTERN)? "extern" : "static", (Sym->Flags & SC_EXTERN)? "extern" : "static",
Sym->AsmName); Sym->AsmName);
@ -378,14 +378,14 @@ static void EmitDebugInfo (void)
while (Sym) { while (Sym) {
if ((Sym->Flags & (SC_CONST|SC_TYPE)) == 0) { if ((Sym->Flags & (SC_CONST|SC_TYPE)) == 0) {
if (Sym->Flags & SC_AUTO) { if (Sym->Flags & SC_AUTO) {
AddTextLine ("\t.dbg\tsym, \"%s\", auto, %d", AddTextLine ("\t.dbg\tsym, \"%s\", \"\", auto, %d",
Sym->Name, Sym->V.Offs); Sym->Name, Sym->V.Offs);
} else if (Sym->Flags & SC_REGISTER) { } else if (Sym->Flags & SC_REGISTER) {
AddTextLine ("\t.dbg\tsym, \"%s\", register, %d", AddTextLine ("\t.dbg\tsym, \"%s\", \"\", register, %d",
Sym->Name, Sym->V.R.RegOffs); Sym->Name, Sym->V.R.RegOffs);
} else { } else {
AddTextLine ("\t.dbg\tsym, \"%s\", %s, \"%s\"", AddTextLine ("\t.dbg\tsym, \"%s\", \"\", %s, \"%s\"",
Sym->Name, Sym->Name,
(Sym->Flags & SC_EXTERN)? "extern" : "static", (Sym->Flags & SC_EXTERN)? "extern" : "static",
Sym->AsmName); Sym->AsmName);