X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fld65%2Flineinfo.h;h=db4f84f4a615f1f9a0fd4ce7aaf51aa61a2d4f06;hb=35e1184901ca38bdb2e56d154ed3b71f6096eacc;hp=bc7106effefc33a52f49810231a4bc8256b7c274;hpb=f04d65a662482ed181e8c3fb9308d71692d0670f;p=cc65 diff --git a/src/ld65/lineinfo.h b/src/ld65/lineinfo.h index bc7106eff..db4f84f4a 100644 --- a/src/ld65/lineinfo.h +++ b/src/ld65/lineinfo.h @@ -73,11 +73,11 @@ struct Segment; */ typedef struct LineInfo LineInfo; struct LineInfo { + unsigned Id; /* Line info id */ struct FileInfo* File; /* File struct for this line if any */ unsigned Type; /* Type of line info */ FilePos Pos; /* Position in file */ - Collection Fragments; /* Fragments for this line */ - Collection Spans; /* Spans for this line */ + unsigned* Spans; /* Spans for this line */ }; @@ -95,17 +95,17 @@ LineInfo* ReadLineInfo (FILE* F, struct ObjData* O); /* Read a line info from a file and return it */ void FreeLineInfo (LineInfo* LI); -/* Free a LineInfo structure. This function will not handle a non empty - * Fragments collection, it can only be used to free incomplete line infos. - */ +/* Free a LineInfo structure. */ void ReadLineInfoList (FILE* F, struct ObjData* O, Collection* LineInfos); /* Read a list of line infos stored as a list of indices in the object file, * make real line infos from them and place them into the passed collection. */ -void RelocLineInfo (struct Segment* S); -/* Relocate the line info for a segment. */ +const LineInfo* GetAsmLineInfo (const Collection* LineInfos); +/* Find a line info of type LI_TYPE_ASM in the given collection and return it. + * Return NULL if no such line info was found. + */ #if defined(HAVE_INLINE) INLINE const FilePos* GetSourcePos (const LineInfo* LI) @@ -128,7 +128,7 @@ INLINE const char* GetSourceName (const LineInfo* LI) #endif #if defined(HAVE_INLINE) -INLINE unsigned long GetSourceLine (const LineInfo* LI) +INLINE unsigned GetSourceLine (const LineInfo* LI) /* Return the source file line from the given line info */ { return LI->Pos.Line; @@ -160,7 +160,7 @@ INLINE const char* GetSourceNameFromList (const Collection* LineInfos) #endif #if defined(HAVE_INLINE) -INLINE unsigned long GetSourceLineFromList (const Collection* LineInfos) +INLINE unsigned GetSourceLineFromList (const Collection* LineInfos) /* Return the source file line from a list of line infos */ { /* The relevant entry is in slot zero */ @@ -171,6 +171,15 @@ INLINE unsigned long GetSourceLineFromList (const Collection* LineInfos) GetSourceLine ((const LineInfo*) CollConstAt ((LineInfos), 0)) #endif +unsigned LineInfoCount (void); +/* Return the total number of line infos */ + +void AssignLineInfoIds (void); +/* Assign the ids to the line infos */ + +void PrintDbgLineInfo (FILE* F); +/* Output the line infos to a debug info file */ + /* End of lineinfo.h */