1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-25 13:29:41 +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",
};
StrBuf Name = STATIC_STRBUF_INITIALIZER;
StrBuf AsmName = STATIC_STRBUF_INITIALIZER;
int StorageClass;
StrBuf Name = STATIC_STRBUF_INITIALIZER;
StrBuf Type = STATIC_STRBUF_INITIALIZER;
StrBuf AsmName = STATIC_STRBUF_INITIALIZER;
int StorageClass;
/* Parameters are separated by a comma */
@ -131,6 +132,17 @@ void DbgInfoFunc (void)
/* Comma expected */
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 */
if (CurTok.Tok != TOK_IDENT) {
ErrorSkip ("Storage class specifier expected");
@ -156,6 +168,7 @@ void DbgInfoFunc (void)
/* Free memory used for the strings */
SB_Done (&AsmName);
SB_Done (&Type);
SB_Done (&Name);
}
@ -222,10 +235,11 @@ void DbgInfoSym (void)
"STATIC",
};
StrBuf Name = STATIC_STRBUF_INITIALIZER;
StrBuf AsmName = STATIC_STRBUF_INITIALIZER;
int StorageClass;
int Offs;
StrBuf Name = STATIC_STRBUF_INITIALIZER;
StrBuf Type = STATIC_STRBUF_INITIALIZER;
StrBuf AsmName = STATIC_STRBUF_INITIALIZER;
int StorageClass;
int Offs;
/* Parameters are separated by a comma */
@ -242,6 +256,17 @@ void DbgInfoSym (void)
/* Comma expected */
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 */
if (CurTok.Tok != TOK_IDENT) {
ErrorSkip ("Storage class specifier expected");
@ -276,6 +301,7 @@ void DbgInfoSym (void)
/* Free memory used for the strings */
SB_Done (&AsmName);
SB_Done (&Type);
SB_Done (&Name);
}

View File

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