X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fbreakpoint.c;h=48f8aede013f971bb785bff717831c5d613bdb50;hb=ea36d3d79b9dfe3598faca5e267efd5980b94d4a;hp=44f78d732387541f2651e33855f4cce0f769d9e5;hpb=62272dd0e7254b19a484fa1a2050ba15504d3ece;p=sbcl.git diff --git a/src/runtime/breakpoint.c b/src/runtime/breakpoint.c index 44f78d7..48f8aed 100644 --- a/src/runtime/breakpoint.c +++ b/src/runtime/breakpoint.c @@ -35,7 +35,7 @@ static void *compute_pc(lispobj code_obj, int pc_offset) { struct code *code; - code = (struct code *)PTR(code_obj); + code = (struct code *)native_pointer(code_obj); return (void *)((char *)code + HeaderValue(code->header)*sizeof(lispobj) + pc_offset); } @@ -54,7 +54,15 @@ void breakpoint_remove(lispobj code_obj, int pc_offset, void breakpoint_do_displaced_inst(os_context_t* context, unsigned long orig_inst) { -#if !defined(hpux) && !defined(irix) && !defined(__i386__) + /* on platforms with sigreturn(), we go directly back from + * arch_do_displaced_inst() to lisp code, so we need to clean up + * our bindings now. (side note: I'd love to know in exactly what + * scenario the speed of breakpoint handling is critical enough to + * justify this maintenance mess) + * + * -dan 2001.08.09 */ + +#if !(defined(hpux) || defined(irix) || defined(__i386__) || defined(alpha)) undo_fake_foreign_function_call(context); #endif arch_do_displaced_inst(context, orig_inst); @@ -102,7 +110,7 @@ static int compute_offset(os_context_t *context, lispobj code) return 0; else { unsigned long code_start; - struct code *codeptr = (struct code *)PTR(code); + struct code *codeptr = (struct code *)native_pointer(code); #ifdef parisc unsigned long pc = *os_context_pc_addr(context) & ~3; #else @@ -122,7 +130,10 @@ static int compute_offset(os_context_t *context, lispobj code) } } } - +/* FIXME: I can see no really good reason these couldn't be merged, but haven't + * tried. The sigprocmask() call would work just as well on alpha as it + * presumably does on x86 -dan 2001.08.10 + */ #ifndef __i386__ void handle_breakpoint(int signal, siginfo_t *info, os_context_t *context) { @@ -171,7 +182,7 @@ void *handle_function_end_breakpoint(int signal, siginfo_t *info, fake_foreign_function_call(context); code = find_code(context); - codeptr = (struct code *)PTR(code); + codeptr = (struct code *)native_pointer(code); funcall3(SymbolFunction(HANDLE_BREAKPOINT), compute_offset(context, code), @@ -197,7 +208,7 @@ void *handle_function_end_breakpoint(int signal, siginfo_t *info, fake_foreign_function_call(context); code = find_code(context); - codeptr = (struct code *)PTR(code); + codeptr = (struct code *)native_pointer(code); /* Don't disallow recursive breakpoint traps. Otherwise, we can't * use debugger breakpoints anywhere in here. */