]> git.sur5r.net Git - cc65/blobdiff - src/ca65/dbginfo.c
Fixed a problem with --feature labels_without_colons: The scanner inserts
[cc65] / src / ca65 / dbginfo.c
index b921f7af8ecb4928c7ab3e9078801e2757fbad96..760b73db3838f4356f40638a91a81469c23620ce 100644 (file)
@@ -1,15 +1,15 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                                dbginfo.c                                 */
+/*                                dbginfo.c                                 */
 /*                                                                           */
-/*                        Handle the .dbg commands                          */
+/*                        Handle the .dbg commands                          */
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000     Ullrich von Bassewitz                                        */
-/*              Wacholderweg 14                                              */
-/*              D-70597 Stuttgart                                            */
-/* EMail:       uz@musoftware.de                                             */
+/* (C) 2000-2003 Ullrich von Bassewitz                                       */
+/*               Römerstraße 52                                              */
+/*               D-70794 Filderstadt                                         */
+/* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -39,6 +39,7 @@
 #include "error.h"
 #include "expr.h"
 #include "filetab.h"
+#include "lineinfo.h"
 #include "nexttok.h"
 #include "dbginfo.h"
 
@@ -57,9 +58,12 @@ void DbgInfoFile (void)
     unsigned long Size;
     unsigned long MTime;
 
+    /* Parameters are separated by a comma */
+    ConsumeComma ();
+
     /* Name */
     if (Tok != TOK_STRCON) {
-               ErrorSkip (ERR_STRCON_EXPECTED);
+               ErrorSkip ("String constant expected");
                return;
     }
     strcpy (Name, SVal);
@@ -89,9 +93,20 @@ void DbgInfoLine (void)
     unsigned Index;
     long LineNum;
 
+    /* If a parameters follow, this is actual line info. If no parameters
+     * follow, the last line info is terminated.
+     */
+    if (Tok == TOK_SEP) {
+       ClearLineInfo ();
+       return;
+    }
+
+    /* Parameters are separated by a comma */
+    ConsumeComma ();
+
     /* The name of the file follows */
     if (Tok != TOK_STRCON) {
-       ErrorSkip (ERR_STRCON_EXPECTED);
+       ErrorSkip ("String constant expected");
        return;
     }
 
@@ -107,12 +122,12 @@ void DbgInfoLine (void)
     /* Line number */
     LineNum = ConstExpression ();
     if (LineNum < 0) {
-       ErrorSkip (ERR_RANGE);
+       ErrorSkip ("Line number is out of valid range");
        return;
     }
 
-    /* ## Remember the line info */
-
+    /* Remember the line info */
+    GenLineInfo (Index, LineNum);
 }
 
 
@@ -120,7 +135,7 @@ void DbgInfoLine (void)
 void DbgInfoSym (void)
 /* Parse and handle SYM subcommand of the .dbg pseudo instruction */
 {
-    ErrorSkip (ERR_NOT_IMPLEMENTED);
+    ErrorSkip ("Not implemented");
 }