X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fca65%2Fdbginfo.c;h=760b73db3838f4356f40638a91a81469c23620ce;hb=69485b5000b1a8363a52be19210da1095d931a4b;hp=b921f7af8ecb4928c7ab3e9078801e2757fbad96;hpb=b86a6b97490eaaf4b919c10a68a7229235f7030f;p=cc65 diff --git a/src/ca65/dbginfo.c b/src/ca65/dbginfo.c index b921f7af8..760b73db3 100644 --- a/src/ca65/dbginfo.c +++ b/src/ca65/dbginfo.c @@ -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"); }