/*****************************************************************************/
/* */
-/* 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 */
#include "error.h"
#include "expr.h"
#include "filetab.h"
+#include "lineinfo.h"
#include "nexttok.h"
#include "dbginfo.h"
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);
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;
}
/* 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);
}
void DbgInfoSym (void)
/* Parse and handle SYM subcommand of the .dbg pseudo instruction */
{
- ErrorSkip (ERR_NOT_IMPLEMENTED);
+ ErrorSkip ("Not implemented");
}