Added line infos

git-svn-id: svn://svn.cc65.org/cc65/trunk@748 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2001-05-23 19:03:40 +00:00
parent ea2cf602b0
commit bfbedfa54b
26 changed files with 451 additions and 77 deletions

View File

@@ -48,6 +48,7 @@
#include "xmalloc.h"
/* ca65 */
#include "objfile.h"
#include "lineinfo.h"
@@ -128,6 +129,14 @@ void GenLineInfo (unsigned FileIndex, unsigned long LineNum)
void ClearLineInfo (void)
/* Clear the current line info */
{
CurLineInfo = 0;
}
void MakeLineInfoIndex (void)
/* Walk over the line info list and make an index of all entries ignoring
* those with a usage count of zero.
@@ -145,3 +154,37 @@ void MakeLineInfoIndex (void)
void WriteLineInfo (void)
/* Write a list of all line infos to the object file. */
{
LineInfo* LI;
/* Tell the object file module that we're about to write line infos */
ObjStartLineInfos ();
/* Check if debug info is requested */
if (DbgSyms) {
/* Write the line info count to the list */
ObjWriteVar (LineInfoValid);
/* Walk through list and write all line infos that have references */
LI = LineInfoRoot;
while (LI) {
if (LI->Usage) {
/* Write the source file position */
ObjWritePos (&LI->Pos);
}
LI = LI->Next;
}
} else {
/* No line infos */
ObjWriteVar (0);
}
}