- /* Read the file position of the fragment */
- ReadFilePos (F, &Pos);
-
- /* Generate a LineInfo for this fragment. First check if this fragment
- * was generated by the same line than that before. If not, generate
- * a new LineInfo.
- */
- if (LI == 0 || LI->Pos.Line != Pos.Line || LI->Pos.Col != Pos.Col ||
- LI->Pos.Name != Pos.Name) {
- /* We don't have a previous line info or this one is different */
- LI = NewLineInfo (O, &Pos);
- CollAppend (&O->LineInfos, LI);
- }
- AddLineInfo (Frag, LI);
-
- /* Read additional line info and resolve it */
- LineInfoIndex = ReadVar (F);
- if (LineInfoIndex) {
- --LineInfoIndex;
- /* The line info index was written by the assembler and must
- * therefore be part of the line infos read from the object file.
- * To make sure this is true, don't compare against the count
- * of line infos in the collection (which grows) but against the
- * count initialized when reading from the file.
- */
- if (LineInfoIndex >= O->LineInfoCount) {
- Internal ("In module `%s', file `%s', line %lu: Invalid line "
- "info with index %u (max count %u)",
- GetObjFileName (O),
- GetFragmentSourceName (Frag),
- GetFragmentSourceLine (Frag),
- LineInfoIndex,
- O->LineInfoCount);
- }
- /* Add line info to the fragment */
- AddLineInfo (Frag, CollAt (&O->LineInfos, LineInfoIndex));
- }