#include "runtime.h"
#include "sbcl.h"
-#include "globals.h"
-#include "vars.h"
-#include "parse.h"
-#include "os.h"
-#include "interrupt.h"
-#include "lispregs.h"
-#include "monitor.h"
+
+/* Almost all of this file can be skipped if we're not supporting LDB. */
+#if defined(LISP_FEATURE_SB_LDB)
+
#include "print.h"
#include "arch.h"
#include "interr.h"
#include "gc.h"
#include "search.h"
#include "purify.h"
+#include "globals.h"
+#include "lispregs.h"
+#include "interrupt.h"
/* When we need to do command input, we use this stream, which is not
* in general stdin, so that things will "work" (as well as being
{
printf("CSP\t=\t0x%08lX\n", (unsigned long)current_control_stack_pointer);
printf("FP\t=\t0x%08lX\n", (unsigned long)current_control_frame_pointer);
-#if !defined(ibmrt) && !defined(__i386__)
+#if !defined(__i386__)
printf("BSP\t=\t0x%08X\n", (unsigned long)current_binding_stack_pointer);
#endif
#ifdef __i386__
#endif
printf("DYNAMIC\t=\t0x%08lx\n", (unsigned long)DYNAMIC_SPACE_START);
-#if defined(ibmrt) || defined(__i386__)
+#if defined(__i386__)
printf("ALLOC\t=\t0x%08lx\n",
(unsigned long)SymbolValue(ALLOCATION_POINTER));
printf("TRIGGER\t=\t0x%08lx\n",
return;
}
if (more_p(ptr)) {
- addr = (lispobj *)PTR((long)parse_addr(ptr));
+ addr = (lispobj *)native_pointer((long)parse_addr(ptr));
if (more_p(ptr)) {
count = parse_number(ptr);
}
obj = *end;
addr = end;
end += 2;
- if (TypeOf(obj) == type_FunctionHeader)
- print((long)addr | type_FunctionPointer);
- else if (LowtagOf(obj) == type_OtherImmediate0 || LowtagOf(obj) == type_OtherImmediate1)
- print((lispobj)addr | type_OtherPointer);
- else
+ if (widetag_of(obj) == SIMPLE_FUN_HEADER_WIDETAG) {
+ print((long)addr | FUN_POINTER_LOWTAG);
+ } else if (lowtag_of(obj) == OTHER_IMMEDIATE_0_LOWTAG ||
+ lowtag_of(obj) == OTHER_IMMEDIATE_1_LOWTAG) {
+ print((lispobj)addr | OTHER_POINTER_LOWTAG);
+ } else {
print((lispobj)addr);
- if (count == -1)
+ } if (count == -1) {
return;
+ }
}
}
lispobj thing = parse_lispobj(ptr), function, result = 0, cons, args[3];
int numargs;
- if (LowtagOf(thing) == type_OtherPointer) {
- switch (TypeOf(*(lispobj *)(thing-type_OtherPointer))) {
- case type_SymbolHeader:
+ if (lowtag_of(thing) == OTHER_POINTER_LOWTAG) {
+ switch (widetag_of(*(lispobj *)(thing-OTHER_POINTER_LOWTAG))) {
+ case SYMBOL_HEADER_WIDETAG:
for (cons = SymbolValue(INITIAL_FDEFN_OBJECTS);
cons != NIL;
cons = CONS(cons)->cdr) {
goto fdefn;
}
}
- printf("symbol 0x%08lx is undefined.\n", (long unsigned)thing);
+ printf("Symbol 0x%08lx is undefined.\n", (long unsigned)thing);
return;
- case type_Fdefn:
+ case FDEFN_WIDETAG:
fdefn:
- function = FDEFN(thing)->function;
+ function = FDEFN(thing)->fun;
if (function == NIL) {
- printf("fdefn 0x%08lx is undefined.\n", (long unsigned)thing);
+ printf("Fdefn 0x%08lx is undefined.\n", (long unsigned)thing);
return;
}
break;
return;
}
}
- else if (LowtagOf(thing) != type_FunctionPointer) {
+ else if (lowtag_of(thing) != FUN_POINTER_LOWTAG) {
printf("0x%08lx is not a function pointer, symbol, or fdefn object.\n",
(long unsigned)thing);
return;
(unsigned long)catch, (unsigned long)(catch->current_uwp),
(unsigned long)(catch->current_cont),
(unsigned long)component_ptr_from_pc((void*)catch->entry_pc) +
- type_OtherPointer,
+ OTHER_POINTER_LOWTAG,
(unsigned long)catch->entry_pc);
#endif
brief_print((lispobj)catch->tag);
{
longjmp(curbuf, 1);
}
+
+#endif /* defined(LISP_FEATURE_SB_LDB) */
+
+/* what we do when things go badly wrong at a low level */
+void
+monitor_or_something()
+{
+#if defined(LISP_FEATURE_SB_LDB)
+ ldb_monitor();
+#else
+ fprintf(stderr, "There's no LDB in this build; exiting.\n");
+ exit(1);
+#endif
+}