Added dbg file generation

git-svn-id: svn://svn.cc65.org/cc65/trunk@764 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2001-05-29 07:39:46 +00:00
parent 45242a8e02
commit 3889a2bec9
20 changed files with 344 additions and 132 deletions

View File

@@ -312,7 +312,13 @@ Section* ReadSection (FILE* F, ObjData* O)
LineInfoIndex = ReadVar (F);
if (LineInfoIndex) {
--LineInfoIndex;
CHECK (LineInfoIndex < O->LineInfoCount);
if (LineInfoIndex >= O->LineInfoCount) {
Internal ("In module `%s', file `%s', line %lu: Invalid line "
"info with index %u (max count %u)",
GetObjFileName (O),
GetSourceFileName (O, Frag->Pos.Name),
Frag->Pos.Line, LineInfoIndex, O->LineInfoCount);
}
/* Point from the fragment to the line info... */
Frag->LI = O->LineInfos[LineInfoIndex];
/* ...and back from the line info to the fragment */
@@ -495,6 +501,7 @@ void SegWrite (FILE* Tgt, Segment* S, SegWriteFunc F, void* Data)
/* If we have fill bytes, write them now */
WriteMult (Tgt, S->FillVal, Sec->Fill);
Offs += Sec->Fill;
/* Loop over all fragments in this section */
Frag = Sec->FragRoot;