From: uz Date: Thu, 18 Aug 2011 10:04:01 +0000 (+0000) Subject: Mark imports with a special type tag instead of relying on the export pointer X-Git-Tag: V2.13.3~261 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e53f4fa1636461cd517ef40b9527b3ec404c16ce;p=cc65 Mark imports with a special type tag instead of relying on the export pointer being valid, because the export may not be available if the module was compiled without debug information. git-svn-id: svn://svn.cc65.org/cc65/trunk@5201 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/dbginfo/dbginfo.c b/src/dbginfo/dbginfo.c index 31bf92f66..d0e58d4de 100644 --- a/src/dbginfo/dbginfo.c +++ b/src/dbginfo/dbginfo.c @@ -3605,6 +3605,7 @@ static void ParseSym (InputData* D) case TOK_TYPE: switch (D->Tok) { case TOK_EQUATE: Type = CC65_SYM_EQUATE; break; + case TOK_IMPORT: Type = CC65_SYM_IMPORT; break; case TOK_LABEL: Type = CC65_SYM_LABEL; break; default: ParseError (D, CC65_ERROR, @@ -5621,8 +5622,8 @@ const cc65_symbolinfo* cc65_symbol_inrange (cc65_dbginfo Handle, cc65_addr Start break; } - /* Ignore non-labels and imports */ - if (Item->Type != CC65_SYM_LABEL || Item->Exp.Info != 0) { + /* Ignore non-labels (this will also ignore imports) */ + if (Item->Type != CC65_SYM_LABEL) { continue; } diff --git a/src/dbginfo/dbginfo.h b/src/dbginfo/dbginfo.h index 0e28225b3..71f7c5a7b 100644 --- a/src/dbginfo/dbginfo.h +++ b/src/dbginfo/dbginfo.h @@ -400,17 +400,22 @@ void cc65_free_segmentinfo (cc65_dbginfo handle, const cc65_segmentinfo* info); typedef enum { CC65_SYM_EQUATE, CC65_SYM_LABEL, /* Some sort of address */ + CC65_SYM_IMPORT, /* An import */ } cc65_symbol_type; /* Notes: * - If the symbol is segment relative, the segment id gives segment * information, otherwise it contains CC65_INV_ID. - * - If export_id is valid (not CC65_INV_ID), the symbol is an import and - * export_id allows to retrieve the corresponding export. The fields - * symbol_value and segment_id are taken from the export, since imports - * have no value or segments by itself. symbol_type and symbol_size are - * more or less unusable because they don't have a meaning for imports. - * - For normal symbols (not cheap locals) parent_id contains CC65_INV_ID. + * - If the type is CC65_SYM_IMPORT, export_id may contain the id of the + * export. This is not the case if the module contaiing the export doesn't + * have debug information. + * - For an import, the fields symbol_value and segment_id are taken from + * the export, if it is available, since imports have no value or segments + * by itself. + * - For an import symbol_type and symbol_size are more or less unusable + * because they don't have a meaning for imports. + * - For normal symbols (not cheap locals) parent_id contains CC65_INV_ID, + * for cheap locals it contains the symbol id of the parent symbol. */ typedef struct cc65_symboldata cc65_symboldata; struct cc65_symboldata {