1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-12 17:30:50 +00:00

More changes to account for modules without debug info.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5204 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2011-08-18 10:26:13 +00:00
parent 0077e37182
commit ec6acb8606
2 changed files with 21 additions and 7 deletions

View File

@ -1254,8 +1254,12 @@ static void CopyModInfo (cc65_moduledata* D, const ModInfo* M)
D->library_id = M->Lib.Info->Id; D->library_id = M->Lib.Info->Id;
} else { } else {
D->library_id = CC65_INV_ID; D->library_id = CC65_INV_ID;
}
if (M->MainScope) {
D->scope_id = M->MainScope->Id;
} else {
D->scope_id = CC65_INV_ID;
} }
D->scope_id = M->MainScope->Id;
} }
@ -4313,14 +4317,20 @@ static void ProcessScopeInfo (InputData* D)
} }
} }
/* Walk over all modules, check that eacxh one has a main scope assigned, /* Walk over all modules. If a module doesn't have scopes, it wasn't
* then sort the scopes by name * compiled with debug info which is ok. If it has debug info, it must
* also have a main scope. If there are scopes, sort them by name.
*/ */
for (I = 0; I < CollCount (&D->Info->ModInfoById); ++I) { for (I = 0; I < CollCount (&D->Info->ModInfoById); ++I) {
/* Get this module */ /* Get this module */
ModInfo* M = CollAt (&D->Info->ModInfoById, I); ModInfo* M = CollAt (&D->Info->ModInfoById, I);
/* Ignore modules without any scopes (no debug info) */
if (CollCount (&M->ScopeInfoByName) == 0) {
continue;
}
/* Must have a main scope */ /* Must have a main scope */
if (M->MainScope == 0) { if (M->MainScope == 0) {
ParseError (D, ParseError (D,

View File

@ -205,7 +205,11 @@ void cc65_free_lineinfo (cc65_dbginfo handle, const cc65_lineinfo* info);
/* Module information */ /* Module information
* Notes:
* - scope_id contains CC65_INV_ID if the module was compiled without
* debug information.
*/
typedef struct cc65_moduledata cc65_moduledata; typedef struct cc65_moduledata cc65_moduledata;
struct cc65_moduledata { struct cc65_moduledata {
unsigned module_id; /* The internal module id */ unsigned module_id; /* The internal module id */
@ -406,15 +410,15 @@ typedef enum {
/* Notes: /* Notes:
* - If the symbol is segment relative, the segment id gives segment * - If the symbol is segment relative, the segment id gives segment
* information, otherwise it contains CC65_INV_ID. * information, otherwise it contains CC65_INV_ID.
* - If the type is CC65_SYM_IMPORT, export_id may contain the id of the * - 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 * export. This is not the case if the module contaiing the export doesn't
* have debug information. * have debug information.
* - For an import, the fields symbol_value and segment_id are taken from * - 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 * the export, if it is available, since imports have no value or segments
* by itself. * by itself.
* - For an import symbol_type and symbol_size are more or less unusable * - For an import symbol_type and symbol_size are more or less unusable
* because they don't have a meaning for imports. * because they don't have a meaning for imports.
* - For normal symbols (not cheap locals) parent_id contains CC65_INV_ID, * - For normal symbols (not cheap locals) parent_id contains CC65_INV_ID,
* for cheap locals it contains the symbol id of the parent symbol. * for cheap locals it contains the symbol id of the parent symbol.
*/ */
typedef struct cc65_symboldata cc65_symboldata; typedef struct cc65_symboldata cc65_symboldata;