]> Shamusworld >> Repos - rmac/blobdiff - error.c
.equr overhaul part 4: handle equrundef (and the other permutations of the directive)
[rmac] / error.c
diff --git a/error.c b/error.c
index 1452e98f8a3ac8339f84a38bbcf43b4ad93942fe..4402610c6bb331a4d21202c631b63cae279eb310 100644 (file)
--- a/error.c
+++ b/error.c
 #include <stdarg.h>
 #include <token.h>
 #include "listing.h"
-#include "token.h"
+char * interror_msg[] = {
+       "Unknown internal error",       // Error not referenced, should not be displayed
+       "Unknown internal error",       // Error not referenced, should not be displayed
+       "Bad MULTX entry in chrtab",                            // Error #2
+       "Unknown internal error",       // Error not referenced, should not be displayed
+       "Bad fixup type",                                                       // Error #4
+       "Bad operator in expression stream",            // Error #5
+       "Can't find generated code in section",         // Error #6
+       "Fixup (loc) out of range"                                      // Error #7
+       "Absolute top filename found"                           // Error #8
+       ""
+};
 
 // Exported variables
 int errcnt;                                            // Error count
@@ -127,7 +138,8 @@ int error(const char * text, ...)
 
                        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:
@@ -203,7 +215,7 @@ int interror(int n)
        char buf[EBUFSIZ];
 
        err_setup();
-       sprintf(buf, "%s %d: Internal error #%d\n", curfname, curlineno, n);
+       sprintf(buf, "%s %d: Internal error #%d: %s\n", curfname, curlineno, n, interror_msg[n]);
 
        if (listing > 0)
                ship_ln(buf);