]> git.sur5r.net Git - cc65/blobdiff - src/ca65/dbginfo.c
Complete redesign of line info generation. Uses spans instead of a fragment
[cc65] / src / ca65 / dbginfo.c
index 59390cc62ecc1a3f4f9aa6c9d6ed2c396c3a1820..86a470d6c80577aaf541741a18edb336573318ab 100644 (file)
 
 
 /*****************************************************************************/
-/*                                          Code                                    */
+/*                                          Data                                    */
+/*****************************************************************************/
+
+
+
+/* The current line info */
+static LineInfo* CurLineInfo = 0;
+
+
+
+/*****************************************************************************/
+/*                                   Code                                    */
 /*****************************************************************************/
 
 
@@ -99,11 +110,16 @@ void DbgInfoLine (void)
     long Line;
     FilePos Pos = STATIC_FILEPOS_INITIALIZER;
 
+    /* Any new line info terminates the last one */
+    if (CurLineInfo) {
+        EndLine (CurLineInfo);
+        CurLineInfo = 0;
+    }
+
     /* If a parameters follow, this is actual line info. If no parameters
      * follow, the last line info is terminated.
      */
     if (CurTok.Tok == TOK_SEP) {
-       ClearLineInfo (LI_SLOT_EXT);
        return;
     }
 
@@ -133,8 +149,8 @@ void DbgInfoLine (void)
     }
     Pos.Line = Line;
 
-    /* Remember the line info */
-    GenLineInfo (LI_SLOT_EXT, &Pos);
+    /* Generate a new external line info */
+    CurLineInfo = StartLine (&Pos, LI_TYPE_EXT, 0);
 }