X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fld65%2Fobjdata.c;h=2a7a0ac1d9a9f1161c6fe246da4e2294193c68fc;hb=35e1184901ca38bdb2e56d154ed3b71f6096eacc;hp=efd4145c30ced02be06549db1b3494c4206a9cb6;hpb=374b106b06ee355613e39ac802a4a2988ee7d95a;p=cc65 diff --git a/src/ld65/objdata.c b/src/ld65/objdata.c index efd4145c3..2a7a0ac1d 100644 --- a/src/ld65/objdata.c +++ b/src/ld65/objdata.c @@ -79,6 +79,7 @@ ObjData* NewObjData (void) O->MTime = 0; O->Start = 0; O->Flags = 0; + O->HLLSymBaseId = 0; O->SymBaseId = 0; O->ScopeBaseId = 0; O->SpanBaseId = 0; @@ -87,6 +88,7 @@ ObjData* NewObjData (void) O->Exports = EmptyCollection; O->Imports = EmptyCollection; O->DbgSyms = EmptyCollection; + O->HLLDbgSyms = EmptyCollection; O->LineInfos = EmptyCollection; O->StringCount = 0; O->Strings = 0; @@ -122,6 +124,7 @@ void FreeObjData (ObjData* O) } DoneCollection (&O->Imports); DoneCollection (&O->DbgSyms); + DoneCollection (&O->HLLDbgSyms); for (I = 0; I < CollCount (&O->LineInfos); ++I) { FreeLineInfo (CollAtUnchecked (&O->LineInfos, I)); @@ -243,6 +246,18 @@ struct Export* GetObjExport (const ObjData* O, unsigned Id) +struct DbgSym* GetObjDbgSym (const ObjData* O, unsigned Id) +/* Get a debug symbol from an object file checking for a valid index */ +{ + if (Id >= CollCount (&O->DbgSyms)) { + Error ("Invalid debug symbol index (%u) in module `%s'", + Id, GetObjFileName (O)); + } + return CollAtUnchecked (&O->DbgSyms, Id); +} + + + struct Scope* GetObjScope (const ObjData* O, unsigned Id) /* Get a scope from an object file checking for a valid index */ { @@ -297,3 +312,4 @@ void PrintDbgModules (FILE* F) +