X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fld65%2Fobjfile.c;h=24a9afda81bb3f64c67623acacb23f9493b49f19;hb=35e1184901ca38bdb2e56d154ed3b71f6096eacc;hp=66bcc64fefc1a8cf3ea96514dd0cdd9dd75bc9ff;hpb=3996725f44d4b0137be5f69b892d309d585e4406;p=cc65 diff --git a/src/ld65/objfile.c b/src/ld65/objfile.c index 66bcc64fe..24a9afda8 100644 --- a/src/ld65/objfile.c +++ b/src/ld65/objfile.c @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 1998-2011, Ullrich von Bassewitz */ +/* (C) 1998-2012, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -34,10 +34,6 @@ #include -#include -#include -#include /* EMX needs this */ -#include /* common */ #include "fname.h" @@ -107,6 +103,8 @@ static void ObjReadHeader (FILE* Obj, ObjHeader* H, const char* Name) H->AssertSize = Read32 (Obj); H->ScopeOffs = Read32 (Obj); H->ScopeSize = Read32 (Obj); + H->SpanOffs = Read32 (Obj); + H->SpanSize = Read32 (Obj); } @@ -196,11 +194,18 @@ void ObjReadDbgSyms (FILE* F, unsigned long Pos, ObjData* O) /* Seek to the correct position */ FileSetPos (F, Pos); - /* Read the data */ + /* Read the asm debug symbols */ DbgSymCount = ReadVar (F); CollGrow (&O->DbgSyms, DbgSymCount); for (I = 0; I < DbgSymCount; ++I) { - CollAppend (&O->DbgSyms, ReadDbgSym (F, O, I)); + CollAppend (&O->DbgSyms, ReadDbgSym (F, O, I)); + } + + /* Read the hll debug symbols */ + DbgSymCount = ReadVar (F); + CollGrow (&O->HLLDbgSyms, DbgSymCount); + for (I = 0; I < DbgSymCount; ++I) { + CollAppend (&O->HLLDbgSyms, ReadHLLDbgSym (F, O, I)); } } @@ -281,6 +286,25 @@ void ObjReadScopes (FILE* F, unsigned long Pos, ObjData* O) +void ObjReadSpans (FILE* F, unsigned long Pos, ObjData* O) +/* Read the span table from a file at the given offset */ +{ + unsigned I; + unsigned SpanCount; + + /* Seek to the correct position */ + FileSetPos (F, Pos); + + /* Read the data */ + SpanCount = ReadVar (F); + CollGrow (&O->Spans, SpanCount); + for (I = 0; I < SpanCount; ++I) { + CollAppend (&O->Spans, ReadSpan (F, O, I)); + } +} + + + void ObjAdd (FILE* Obj, const char* Name) /* Add an object file to the module list */ { @@ -328,6 +352,9 @@ void ObjAdd (FILE* Obj, const char* Name) */ ObjReadScopes (Obj, O->Header.ScopeOffs, O); + /* Read the spans from the object file */ + ObjReadSpans (Obj, O->Header.SpanOffs, O); + /* Mark this object file as needed */ O->Flags |= OBJ_REF;