1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 06:31:31 +00:00

If a symbol is an import, the corresponding export does only have a debug

symbol id if the module contains debug information.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5203 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2011-08-18 10:13:11 +00:00
parent b76fc52c1b
commit 0077e37182

View File

@ -259,10 +259,44 @@ void PrintDbgSyms (FILE* F)
GetString (S->Name),
AddrSizeToStr (S->AddrSize));
/* If this is not an import, output its value and - if we have
/* Emit the size only if we know it */
if (S->Size != 0) {
fprintf (F, ",size=%u", S->Size);
}
/* For cheap local symbols, add the owner symbol, for others,
* add the owner scope.
*/
if (SYM_IS_STD (S->Type)) {
fprintf (F, ",scope=%u", O->ScopeBaseId + S->OwnerId);
} else {
fprintf (F, ",parent=%u", O->SymBaseId + S->OwnerId);
}
/* If this is an import, output the id of the matching export.
* If this is not an import, output its value and - if we have
* it - the segment.
*/
if (!SYM_IS_IMPORT (S->Type)) {
if (SYM_IS_IMPORT (S->Type)) {
/* Get the import */
const Import* Imp = GetObjImport (O, S->ImportId);
/* Get the export from the import */
const Export* Exp = Imp->Exp;
/* Output the type */
fputs (",type=imp", F);
/* If this is not a linker generated symbol, and the module
* that contains the export has debug info, output the debug
* symbol id for the export
*/
if (Exp->Obj && OBJ_HAS_DBGINFO (Exp->Obj->Header.Flags)) {
fprintf (F, ",exp=%u", Exp->Obj->SymBaseId + Exp->DbgSymId);
}
} else {
SegExprDesc D;
@ -282,41 +316,6 @@ void PrintDbgSyms (FILE* F)
/* Output the type */
fprintf (F, ",type=%s", SYM_IS_LABEL (S->Type)? "lab" : "equ");
} else {
/* Output the type */
fputs (",type=imp", F);
}
/* Emit the size only if we know it */
if (S->Size != 0) {
fprintf (F, ",size=%u", S->Size);
}
/* For cheap local symbols, add the owner symbol, for others,
* add the owner scope.
*/
if (SYM_IS_STD (S->Type)) {
fprintf (F, ",scope=%u", O->ScopeBaseId + S->OwnerId);
} else {
fprintf (F, ",parent=%u", O->SymBaseId + S->OwnerId);
}
/* If this is an import, output the id of the matching export */
if (SYM_IS_IMPORT (S->Type)) {
/* Get the import */
const Import* Imp = GetObjImport (O, S->ImportId);
/* Get the export from the import */
const Export* Exp = Imp->Exp;
/* If this is not a linker generated symbol, output the debug
* symbol id for the export
*/
if (Exp->Obj) {
fprintf (F, ",exp=%u", Exp->Obj->SymBaseId + Exp->DbgSymId);
}
}
/* Terminate the output line */