#include <stdio.h>
#include <stdarg.h>
+#include <stdlib.h>
#include "arch.h"
#include "signal.h"
lossage_handler = handler;
}
-void
+never_returns
lose(char *fmt, ...)
{
va_list ap;
fprintf(stderr, "\n");
fflush(stderr);
lossage_handler();
+ fprintf(stderr, "Argh! lossage_handler() returned, total confusion..\n");
+ exit(1);
}
\f
/* internal error handler for when the Lisp error system doesn't exist
lispobj debug_print(lispobj string)
{
- fprintf(stderr, "%s\n", (char *)(((struct vector *)PTR(string))->data));
+ /* This is a kludge. It's not actually safe - in general - to use
+ %primitive print on the alpha, because it skips half of the
+ number stack setup that should usually be done on a function call,
+ so the called routine (i.e. this one) ends up being able to overwrite
+ local variables in the caller. Rather than fix this everywhere
+ that %primitive print is used (it's only a debugging aid anyway)
+ we just put guarantee our safety by putting an unused buffer on
+ the stack before doing anything else here */
+ char untouched[32]; /* GCC warns about not using this, but that's the point.. */
+ fprintf(stderr, "%s\n",
+ (char *)(((struct vector *)native_pointer(string))->data),untouched);
return NIL;
}