#include "error.h"
#include <stdarg.h>
+#include <token.h>
#include "listing.h"
#include "token.h"
// Internal variables
static long unused; // For supressing 'write' warnings
-
//
// Report error if not at EOL
//
return 0;
}
-
//
// Cannot create a file
//
exit(1);
}
-
//
// Setup for error message
// o Create error listing file (if necessary)
}
}
-
//
// Display error message (uses printf() style variable arguments)
//
break;
case SRC_IMACRO:
{
- // This is basically SetFilenameForErrorReporting() but we don't call it here
- // as it will clobber curfname. That function is used during fixups only so
- // it really doesn't matter at that point...
+ // This is basically SetFilenameForErrorReporting() but we don't
+ // call it here as it will clobber curfname. That function is used
+ // during fixups only so it really doesn't matter at that point...
char * filename;
-#include <token.h>
FILEREC * fr;
uint16_t fnum = cur_inobj->inobj.imacro->im_macro->cfileno;
+
// Check for absolute top filename (this should never happen)
if (fnum == -1)
interror(8);
filename = fr->frec_name;
- sprintf(buf1, "%s %d: Error: %s\n", filename, cur_inobj->inobj.imacro->im_macro->lineList->lineno, buf);
+ sprintf(buf1, "%s %d: Error: %s\nCalled from: %s %d\n", filename, cur_inobj->inobj.imacro->im_macro->lineList->lineno, buf,
+ curfname, curlineno);
}
break;
case SRC_IREPT:
return ERROR;
}
-
//
// Display warning message (uses printf() style variable arguments)
//
return OK;
}
-
int fatal(const char * s)
{
char buf[EBUFSIZ];
exit(1);
}
-
int interror(int n)
{
char buf[EBUFSIZ];
exit(1);
}
-