From 5050157edac2a79b2f3499d9d81175835aafcee5 Mon Sep 17 00:00:00 2001 From: uz Date: Thu, 1 Sep 2011 20:53:42 +0000 Subject: [PATCH] Make the type of a C symbol available. git-svn-id: svn://svn.cc65.org/cc65/trunk@5295 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/dbginfo/dbginfo.c | 1 + src/dbginfo/dbginfo.h | 1 + src/dbginfo/dbgsh.c | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dbginfo/dbginfo.c b/src/dbginfo/dbginfo.c index 249bdcd04..f7d517c36 100644 --- a/src/dbginfo/dbginfo.c +++ b/src/dbginfo/dbginfo.c @@ -1233,6 +1233,7 @@ static void CopyCSymInfo (cc65_csymdata* D, const CSymInfo* S) D->csym_kind = S->Kind; D->csym_sc = S->SC; D->csym_offs = S->Offs; + D->type_id = GetId (S->Type.Info); D->symbol_id = GetId (S->Sym.Info); D->scope_id = GetId (S->Scope.Info); D->csym_name = S->Name; diff --git a/src/dbginfo/dbginfo.h b/src/dbginfo/dbginfo.h index aa357a4ba..c444a5168 100644 --- a/src/dbginfo/dbginfo.h +++ b/src/dbginfo/dbginfo.h @@ -135,6 +135,7 @@ struct cc65_csymdata { unsigned char csym_kind; /* Kind of c symbol */ unsigned char csym_sc; /* Storage class of c symbol */ int csym_offs; /* Offset for auto and register */ + unsigned type_id; /* Id of the data type */ unsigned symbol_id; /* Attached asm symbol if any */ unsigned scope_id; /* Scope of c symbol */ const char* csym_name; /* Name of the symbol */ diff --git a/src/dbginfo/dbgsh.c b/src/dbginfo/dbgsh.c index 48b042616..4c2e3d79a 100644 --- a/src/dbginfo/dbgsh.c +++ b/src/dbginfo/dbgsh.c @@ -591,7 +591,7 @@ static void PrintCSymbols (const cc65_csyminfo* S) for (I = 0, D = S->data; I < S->count; ++I, ++D) { PrintId (D->csym_id, 6); Print ("%-28s", D->csym_name); - PrintId (0, 6); + PrintId (D->type_id, 6); PrintNumber (D->csym_kind, 4, 6); PrintNumber (D->csym_sc, 4, 6); PrintNumber (D->csym_offs, 4, 8); @@ -1100,7 +1100,7 @@ static void CmdShowCSymbol (Collection* Args) switch (IdType) { case CSymbolId: S = cc65_csym_byid (Info, Id); - break; + break; case ScopeId: S = cc65_csym_byscope (Info, Id); break; -- 2.39.5