X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fmonitor.c;h=ccda1d9f51491ddcf86477344606d7bd946b9795;hb=22b819c0cd0ca0ea5be52ba280b9e9e0b8e86210;hp=b494aaff22cc7db14b6cc4030301076a141337a3;hpb=c81c32ef8a737b0cc61d3c0c6a137cab39baac73;p=sbcl.git diff --git a/src/runtime/monitor.c b/src/runtime/monitor.c index b494aaf..ccda1d9 100644 --- a/src/runtime/monitor.c +++ b/src/runtime/monitor.c @@ -33,6 +33,11 @@ #include "globals.h" #include "lispregs.h" #include "interrupt.h" +#include "thread.h" +#include "genesis/static-symbols.h" +#include "genesis/primitive-objects.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 @@ -174,6 +179,7 @@ regs_cmd(char **ptr) #if !defined(__i386__) printf("BSP\t=\t0x%08X\n", (unsigned long)current_binding_stack_pointer); #endif +#if 0 #ifdef __i386__ printf("BSP\t=\t0x%08lx\n", (unsigned long)SymbolValue(BINDING_STACK_POINTER)); @@ -192,7 +198,7 @@ regs_cmd(char **ptr) (unsigned long)SymbolValue(STATIC_SPACE_FREE_POINTER)); printf("RDONLY\t=\t0x%08lx\n", (unsigned long)SymbolValue(READ_ONLY_SPACE_FREE_POINTER)); - +#endif /* 0 */ #ifdef MIPS printf("FLAGS\t=\t0x%08x\n", current_flags_register); #endif @@ -279,7 +285,7 @@ quit_cmd(char **ptr) fflush(stdout); fgets(buf, sizeof(buf), ldb_in); if (buf[0] == 'y' || buf[0] == 'Y' || buf[0] == '\n') - exit(0); + exit(1); } static void @@ -309,50 +315,51 @@ purify_cmd(char **ptr) static void print_context(os_context_t *context) { - int i; + int i; - for (i = 0; i < NREGS; i++) { - printf("%s:\t", lisp_register_names[i]); + for (i = 0; i < NREGS; i++) { + printf("%s:\t", lisp_register_names[i]); #ifdef __i386__ - brief_print((lispobj)(*os_context_register_addr(context, - i*2))); + brief_print((lispobj)(*os_context_register_addr(context, + i*2))); #else - brief_print((lispobj)(*os_context_register_addr(context,i))); + brief_print((lispobj)(*os_context_register_addr(context,i))); #endif - } - printf("PC:\t\t 0x%08lx\n", - (unsigned long)(*os_context_pc_addr(context))); + } + printf("PC:\t\t 0x%08lx\n", + (unsigned long)(*os_context_pc_addr(context))); } static void print_context_cmd(char **ptr) { - int free; + int free; + struct thread *thread=arch_os_get_current_thread(); - free = SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX)>>2; + free = SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX,thread)>>2; - if (more_p(ptr)) { - int index; - - index = parse_number(ptr); - - if ((index >= 0) && (index < free)) { - printf("There are %d interrupt contexts.\n", free); - printf("printing context %d\n", index); - print_context(lisp_interrupt_contexts[index]); - } else { - printf("There aren't that many/few contexts.\n"); - printf("There are %d interrupt contexts.\n", free); - } + if (more_p(ptr)) { + int index; + + index = parse_number(ptr); + + if ((index >= 0) && (index < free)) { + printf("There are %d interrupt contexts.\n", free); + printf("printing context %d\n", index); + print_context(thread->interrupt_contexts[index]); } else { - if (free == 0) - printf("There are no interrupt contexts!\n"); - else { - printf("There are %d interrupt contexts.\n", free); - printf("printing context %d\n", free - 1); - print_context(lisp_interrupt_contexts[free - 1]); - } + printf("There aren't that many/few contexts.\n"); + printf("There are %d interrupt contexts.\n", free); } + } else { + if (free == 0) + printf("There are no interrupt contexts!\n"); + else { + printf("There are %d interrupt contexts.\n", free); + printf("printing context %d\n", free - 1); + print_context(thread->interrupt_contexts[free - 1]); + } + } } static void @@ -374,8 +381,9 @@ static void catchers_cmd(char **ptr) { struct catch_block *catch; + struct thread *thread=arch_os_get_current_thread(); - catch = (struct catch_block *)SymbolValue(CURRENT_CATCH_BLOCK); + catch = (struct catch_block *)SymbolValue(CURRENT_CATCH_BLOCK,thread); if (catch == NULL) printf("There are no active catchers!\n");