From 5c4c126f50e6fb8184bf9ae4411d17327c24cb91 Mon Sep 17 00:00:00 2001 From: Thiemo Seufer Date: Tue, 27 Sep 2005 15:52:50 +0000 Subject: [PATCH] 0.9.5.1: Use consistently "unsigned int" as C type for an instruction. --- src/code/debug-int.lisp | 6 ++--- src/runtime/alpha-arch.c | 24 +++++++++----------- src/runtime/arch.h | 4 ++-- src/runtime/breakpoint.c | 6 ++--- src/runtime/breakpoint.h | 6 ++--- src/runtime/hppa-arch.c | 38 +++++++++++++++---------------- src/runtime/mips-arch.c | 8 +++---- src/runtime/ppc-arch.c | 43 +++++++++++++++++++++++++----------- src/runtime/sparc-arch.c | 54 ++++++++++++++++++++++++++++++--------------- src/runtime/x86-64-arch.c | 12 +++++----- src/runtime/x86-arch.c | 8 +++---- version.lisp-expr | 2 +- 12 files changed, 122 insertions(+), 89 deletions(-) diff --git a/src/code/debug-int.lisp b/src/code/debug-int.lisp index 66f2c87..4149832 100644 --- a/src/code/debug-int.lisp +++ b/src/code/debug-int.lisp @@ -3044,7 +3044,7 @@ register." ;;; returns the overwritten bits. You must call this in a context in ;;; which GC is disabled, so that Lisp doesn't move objects around ;;; that C is pointing to. -(sb!alien:define-alien-routine "breakpoint_install" sb!alien:unsigned-long +(sb!alien:define-alien-routine "breakpoint_install" sb!alien:unsigned-int (code-obj sb!alien:unsigned-long) (pc-offset sb!alien:int)) @@ -3054,11 +3054,11 @@ register." (sb!alien:define-alien-routine "breakpoint_remove" sb!alien:void (code-obj sb!alien:unsigned-long) (pc-offset sb!alien:int) - (old-inst sb!alien:unsigned-long)) + (old-inst sb!alien:unsigned-int)) (sb!alien:define-alien-routine "breakpoint_do_displaced_inst" sb!alien:void (scp (* os-context-t)) - (orig-inst sb!alien:unsigned-long)) + (orig-inst sb!alien:unsigned-int)) ;;;; breakpoint handlers (layer between C and exported interface) diff --git a/src/runtime/alpha-arch.c b/src/runtime/alpha-arch.c index ee8fb15..339ff80 100644 --- a/src/runtime/alpha-arch.c +++ b/src/runtime/alpha-arch.c @@ -115,24 +115,22 @@ void arch_set_pseudo_atomic_interrupted(os_context_t *context) *os_context_register_addr(context,reg_ALLOC) |= (1L<<63); } -unsigned long arch_install_breakpoint(void *pc) +unsigned int arch_install_breakpoint(void *pc) { unsigned int *ptr = (unsigned int *)pc; - unsigned long result = (unsigned long) *ptr; + unsigned int result = *ptr; *ptr = BREAKPOINT_INST; - os_flush_icache((os_vm_address_t)ptr, sizeof(unsigned long)); + os_flush_icache((os_vm_address_t)ptr, sizeof(unsigned int)); return result; } -void arch_remove_breakpoint(void *pc, unsigned long orig_inst) +void arch_remove_breakpoint(void *pc, unsigned int orig_inst) { - /* was (unsigned int) but gcc complains. Changed to mirror - * install_breakpoint() above */ - unsigned long *ptr=(unsigned long *)pc; + unsigned int *ptr = (unsigned int *)pc; *ptr = orig_inst; - os_flush_icache((os_vm_address_t)pc, sizeof(unsigned long)); + os_flush_icache((os_vm_address_t)pc, sizeof(unsigned int)); } static unsigned int *skipped_break_addr, displaced_after_inst, @@ -142,7 +140,7 @@ static unsigned int *skipped_break_addr, displaced_after_inst, /* This returns a PC value. Lisp code is all in the 32-bit-addressable * space, so we should be ok with an unsigned int. */ unsigned int -emulate_branch(os_context_t *context,unsigned long orig_inst) +emulate_branch(os_context_t *context, unsigned int orig_inst) { int op = orig_inst >> 26; int reg_a = (orig_inst >> 21) & 0x1f; @@ -257,7 +255,7 @@ void arch_do_displaced_inst(os_context_t *context,unsigned int orig_inst) /* Put the original instruction back. */ *pc = orig_inst; - os_flush_icache((os_vm_address_t)pc, sizeof(unsigned long)); + os_flush_icache((os_vm_address_t)pc, sizeof(unsigned int)); skipped_break_addr = pc; /* Figure out where we will end up after running the displaced @@ -272,7 +270,7 @@ void arch_do_displaced_inst(os_context_t *context,unsigned int orig_inst) displaced_after_inst = *next_pc; *next_pc = BREAKPOINT_INST; after_breakpoint=1; - os_flush_icache((os_vm_address_t)next_pc, sizeof(unsigned long)); + os_flush_icache((os_vm_address_t)next_pc, sizeof(unsigned int)); } static void @@ -298,11 +296,11 @@ sigtrap_handler(int signal, siginfo_t *siginfo, os_context_t *context) *os_context_pc_addr(context) -=4; *skipped_break_addr = BREAKPOINT_INST; os_flush_icache((os_vm_address_t)skipped_break_addr, - sizeof(unsigned long)); + sizeof(unsigned int)); skipped_break_addr = NULL; *(unsigned int *)*os_context_pc_addr(context) = displaced_after_inst; - os_flush_icache((os_vm_address_t)*os_context_pc_addr(context), sizeof(unsigned long)); + os_flush_icache((os_vm_address_t)*os_context_pc_addr(context), sizeof(unsigned int)); *os_context_sigmask_addr(context)= orig_sigmask; after_breakpoint=0; /* false */ return; diff --git a/src/runtime/arch.h b/src/runtime/arch.h index 15b5d72..b529137 100644 --- a/src/runtime/arch.h +++ b/src/runtime/arch.h @@ -26,8 +26,8 @@ extern boolean arch_pseudo_atomic_atomic(os_context_t*); extern void arch_set_pseudo_atomic_interrupted(os_context_t*); extern os_vm_address_t arch_get_bad_addr(int, siginfo_t*, os_context_t*); extern unsigned char *arch_internal_error_arguments(os_context_t*); -extern unsigned long arch_install_breakpoint(void *pc); -extern void arch_remove_breakpoint(void *pc, unsigned long orig_inst); +extern unsigned int arch_install_breakpoint(void *pc); +extern void arch_remove_breakpoint(void *pc, unsigned int orig_inst); extern void arch_install_interrupt_handlers(void); extern void arch_do_displaced_inst(os_context_t *context, unsigned int orig_inst); diff --git a/src/runtime/breakpoint.c b/src/runtime/breakpoint.c index 4b3ee03..be487fa 100644 --- a/src/runtime/breakpoint.c +++ b/src/runtime/breakpoint.c @@ -43,19 +43,19 @@ static void *compute_pc(lispobj code_obj, int pc_offset) + pc_offset); } -unsigned long breakpoint_install(lispobj code_obj, int pc_offset) +unsigned int breakpoint_install(lispobj code_obj, int pc_offset) { return arch_install_breakpoint(compute_pc(code_obj, pc_offset)); } void breakpoint_remove(lispobj code_obj, int pc_offset, - unsigned long orig_inst) + unsigned int orig_inst) { arch_remove_breakpoint(compute_pc(code_obj, pc_offset), orig_inst); } void breakpoint_do_displaced_inst(os_context_t* context, - unsigned long orig_inst) + unsigned int orig_inst) { /* on platforms with sigreturn(), we go directly back from * arch_do_displaced_inst() to lisp code, so we need to clean up diff --git a/src/runtime/breakpoint.h b/src/runtime/breakpoint.h index 1f2a482..19e1ef1 100644 --- a/src/runtime/breakpoint.h +++ b/src/runtime/breakpoint.h @@ -12,12 +12,12 @@ #ifndef _BREAKPOINT_H_ #define _BREAKPOINT_H_ -extern unsigned long breakpoint_install(lispobj code_obj, int pc_offset); +extern unsigned int breakpoint_install(lispobj code_obj, int pc_offset); extern void breakpoint_remove(lispobj code_obj, int pc_offset, - unsigned long orig_inst); + unsigned int orig_inst); extern void breakpoint_do_displaced_inst(os_context_t *context, - unsigned long orig_inst); + unsigned int orig_inst); extern void handle_breakpoint(int signal, siginfo_t *info, os_context_t *context); extern void *handle_fun_end_breakpoint(int signal, siginfo_t *info, diff --git a/src/runtime/hppa-arch.c b/src/runtime/hppa-arch.c index 04af27b..3331ed3 100644 --- a/src/runtime/hppa-arch.c +++ b/src/runtime/hppa-arch.c @@ -91,19 +91,19 @@ void arch_skip_instruction(os_context_t *context) ((char *) *os_context_npc_addr(context)) += 4; } -unsigned long arch_install_breakpoint(void *pc) +unsigned int arch_install_breakpoint(void *pc) { - unsigned long *ulpc = (unsigned long *)pc; - unsigned long orig_inst = *ulpc; + unsigned int *ulpc = (unsigned int *)pc; + unsigned int orig_inst = *ulpc; *ulpc = trap_Breakpoint; os_flush_icache((os_vm_address_t)pc, sizeof(*ulpc)); return orig_inst; } -void arch_remove_breakpoint(void *pc, unsigned long orig_inst) +void arch_remove_breakpoint(void *pc, unsigned int orig_inst) { - unsigned long *ulpc = (unsigned long *)pc; + unsigned int *ulpc = (unsigned int *)pc; *ulpc = orig_inst; os_flush_icache((os_vm_address_t)pc, sizeof(*ulpc)); @@ -117,14 +117,14 @@ void arch_do_displaced_inst(os_context_t *context, unsigned int orig_inst) /* We change the next-pc to point to a breakpoint instruction, restore */ /* the original instruction, and exit. We would like to be able to */ /* sigreturn, but we can't, because this is hpux. */ - unsigned long *pc = (unsigned long *)(SC_PC(scp) & ~3); + unsigned int *pc = (unsigned int *)(SC_PC(scp) & ~3); NextPc = SC_NPC(scp); - SC_NPC(scp) = (unsigned)SingleStepTraps | (SC_NPC(scp)&3); + SC_NPC(scp) = (unsigned int)SingleStepTraps | (SC_NPC(scp)&3); BreakpointAddr = pc; *pc = orig_inst; - os_flush_icache((os_vm_address_t)pc, sizeof(unsigned long)); + os_flush_icache((os_vm_address_t)pc, sizeof(unsigned int)); #else /* We set the recovery counter to cover one instruction, put the */ /* original instruction back in, and then resume. We will then trap */ @@ -133,7 +133,7 @@ void arch_do_displaced_inst(os_context_t *context, unsigned int orig_inst) ((struct hp800_thread_state *)scp->sc_ap)->cr0 = 1; scp->sc_ps |= 0x10; - *(unsigned long *)SC_PC(scp) = orig_inst; + *(unsigned int *)SC_PC(scp) = orig_inst; sigreturn(scp); #endif @@ -150,10 +150,10 @@ static void restore_breakpoint(struct sigcontext *scp) if (NextPc == NULL) lose("SingleStepBreakpoint trap at strange time."); - if ((SC_PC(scp)&~3) == (unsigned long)SingleStepTraps) { + if ((SC_PC(scp)&~3) == (unsigned int)SingleStepTraps) { /* The next instruction was not nullified. */ SC_PC(scp) = NextPc; - if ((SC_NPC(scp)&~3) == (unsigned long)SingleStepTraps + 4) { + if ((SC_NPC(scp)&~3) == (unsigned int)SingleStepTraps + 4) { /* The instruction we just stepped over was not a branch, so */ /* we need to fix it up. If it was a branch, it will point to */ /* the correct place. */ @@ -170,7 +170,7 @@ static void restore_breakpoint(struct sigcontext *scp) if (BreakpointAddr) { *BreakpointAddr = trap_Breakpoint; os_flush_icache((os_vm_address_t)BreakpointAddr, - sizeof(unsigned long)); + sizeof(unsigned int)); BreakpointAddr = NULL; } } @@ -179,14 +179,14 @@ static void restore_breakpoint(struct sigcontext *scp) static void sigtrap_handler(int signal, siginfo_t *siginfo, void *void_context) { os_context_t *context = arch_os_get_context(&void_context); - unsigned long bad_inst; + unsigned int bad_inst; #if 0 printf("sigtrap_handler, pc=0x%08x, alloc=0x%08x\n", scp->sc_pcoqh, SC_REG(scp,reg_ALLOC)); #endif - bad_inst = *(unsigned long *)(*os_context_pc_addr(context) & ~3); + bad_inst = *(unsigned int *)(*os_context_pc_addr(context) & ~3); if (bad_inst & 0xfc001fe0) interrupt_handle_now(signal, siginfo, context); else { @@ -240,7 +240,7 @@ static void sigtrap_handler(int signal, siginfo_t *siginfo, void *void_context) static void sigfpe_handler(int signal, siginfo_t *siginfo, void *void_context) { os_context_t *context = arch_os_get_context(&void_context); - unsigned long badinst; + unsigned int badinst; int opcode, r1, r2, t; long op1, op2, res; @@ -251,7 +251,7 @@ static void sigfpe_handler(int signal, siginfo_t *siginfo, void *void_context) switch (siginfo->si_code) { case FPE_INTOVF: /*I_OVFLO: */ - badinst = *(unsigned long *)(*os_context_pc_addr(context) & ~3); + badinst = *(unsigned int *)(*os_context_pc_addr(context) & ~3); opcode = badinst >> 26; if (opcode == 2) { @@ -301,7 +301,7 @@ static void sigfpe_handler(int signal, siginfo_t *siginfo, void *void_context) break; case 0: /* I_COND: ?? Maybe tagged add?? FIXME */ - badinst = *(unsigned long *)(*os_context_pc_addr(context) & ~3); + badinst = *(unsigned int *)(*os_context_pc_addr(context) & ~3); if ((badinst&0xfffff800) == (0xb000e000|reg_ALLOC<<21|reg_ALLOC<<16)) { /* It is an ADDIT,OD i,ALLOC,ALLOC instruction that trapped. */ /* That means that it is the end of a pseudo-atomic. So do the */ @@ -333,11 +333,11 @@ static void sigfpe_handler(int signal, siginfo_t *siginfo, void *void_context) static void sigbus_handler(int signal, siginfo_t *siginfo, void *void_context) { os_context_t *context = arch_os_get_context(&void_context); - unsigned long badinst; + unsigned int badinst; int opcode, r1, r2, t; long op1, op2, res; - badinst = *(unsigned long *)(*os_context_pc_addr(context) & ~3); + badinst = *(unsigned int *)(*os_context_pc_addr(context) & ~3); /* First, test for the pseudo-atomic instruction */ if ((badinst & 0xfffff800) == (0xb000e000 | reg_ALLOC<<21 | diff --git a/src/runtime/mips-arch.c b/src/runtime/mips-arch.c index 6439213..0c9be42 100644 --- a/src/runtime/mips-arch.c +++ b/src/runtime/mips-arch.c @@ -274,7 +274,7 @@ arch_set_pseudo_atomic_interrupted(os_context_t *context) *os_context_register_addr(context, reg_NL4) |= -1LL<<31; } -unsigned long +unsigned int arch_install_breakpoint(void *pc) { unsigned int *ptr = (unsigned int *)pc; @@ -288,7 +288,7 @@ arch_install_breakpoint(void *pc) *ptr = (trap_Breakpoint << 6) | 0xd; os_flush_icache((os_vm_address_t)ptr, INSN_LEN); - return (unsigned long)insn; + return insn; } static inline unsigned int @@ -309,7 +309,7 @@ arch_install_after_breakpoint(void *pc) } void -arch_remove_breakpoint(void *pc, unsigned long orig_inst) +arch_remove_breakpoint(void *pc, unsigned int orig_inst) { unsigned int *ptr = (unsigned int *)pc; @@ -317,7 +317,7 @@ arch_remove_breakpoint(void *pc, unsigned long orig_inst) if (arch_insn_with_bdelay_p(*ptr)) ptr++; - *ptr = (unsigned int)orig_inst; + *ptr = orig_inst; os_flush_icache((os_vm_address_t)ptr, INSN_LEN); } diff --git a/src/runtime/ppc-arch.c b/src/runtime/ppc-arch.c index ce2865b..56fefd0 100644 --- a/src/runtime/ppc-arch.c +++ b/src/runtime/ppc-arch.c @@ -86,24 +86,41 @@ arch_set_pseudo_atomic_interrupted(os_context_t *context) += PSEUDO_ATOMIC_INTERRUPTED_BIAS; } -unsigned long +unsigned int arch_install_breakpoint(void *pc) { - unsigned long *ptr = (unsigned long *)pc; - unsigned long result = *ptr; + unsigned int *ptr = (unsigned int *)pc; + unsigned int result = *ptr; *ptr = (3<<26) | (5 << 21) | trap_Breakpoint; - os_flush_icache((os_vm_address_t) pc, sizeof(unsigned long)); + os_flush_icache((os_vm_address_t) pc, sizeof(unsigned int)); return result; } void -arch_remove_breakpoint(void *pc, unsigned long orig_inst) +arch_remove_breakpoint(void *pc, unsigned int orig_inst) { - *(unsigned long *)pc = orig_inst; - os_flush_icache((os_vm_address_t) pc, sizeof(unsigned long)); + *(unsigned int *)pc = orig_inst; + os_flush_icache((os_vm_address_t) pc, sizeof(unsigned int)); } -static unsigned long *skipped_break_addr, displaced_after_inst; +/* + * Perform the instruction that we overwrote with a breakpoint. As we + * don't have a single-step facility, this means we have to: + * - put the instruction back + * - put a second breakpoint at the following instruction, + * set after_breakpoint and continue execution. + * + * When the second breakpoint is hit (very shortly thereafter, we hope) + * sigtrap_handler gets called again, but follows the AfterBreakpoint + * arm, which + * - puts a bpt back in the first breakpoint place (running across a + * breakpoint shouldn't cause it to be uninstalled) + * - replaces the second bpt with the instruction it was meant to be + * - carries on + * + * Clear? + */ +static unsigned int *skipped_break_addr, displaced_after_inst; static sigset_t orig_sigmask; void @@ -111,20 +128,20 @@ arch_do_displaced_inst(os_context_t *context,unsigned int orig_inst) { /* not sure how we ensure that we get the breakpoint reinstalled * after doing this -dan */ - unsigned long *pc = (unsigned long *)(*os_context_pc_addr(context)); + unsigned int *pc = (unsigned int *)(*os_context_pc_addr(context)); orig_sigmask = *os_context_sigmask_addr(context); sigaddset_blockable(os_context_sigmask_addr(context)); *pc = orig_inst; - os_flush_icache((os_vm_address_t) pc, sizeof(unsigned long)); + os_flush_icache((os_vm_address_t) pc, sizeof(unsigned int)); skipped_break_addr = pc; } static void sigtrap_handler(int signal, siginfo_t *siginfo, os_context_t *context) { - u32 code; + unsigned int code; #ifdef LISP_FEATURE_LINUX os_restore_fp_control(context); #endif @@ -173,12 +190,12 @@ sigtrap_handler(int signal, siginfo_t *siginfo, os_context_t *context) case trap_AfterBreakpoint: *skipped_break_addr = trap_Breakpoint; skipped_break_addr = NULL; - *(unsigned long *)*os_context_pc_addr(context) + *(unsigned int *)*os_context_pc_addr(context) = displaced_after_inst; *os_context_sigmask_addr(context)= orig_sigmask; os_flush_icache((os_vm_address_t) *os_context_pc_addr(context), - sizeof(unsigned long)); + sizeof(unsigned int)); break; default: diff --git a/src/runtime/sparc-arch.c b/src/runtime/sparc-arch.c index 850acfd..f941eae 100644 --- a/src/runtime/sparc-arch.c +++ b/src/runtime/sparc-arch.c @@ -35,11 +35,11 @@ void arch_init(void) os_vm_address_t arch_get_bad_addr(int sig, siginfo_t *code, os_context_t *context) { - unsigned long badinst; - unsigned long *pc; + unsigned int badinst; + unsigned int *pc; int rs1; - pc = (unsigned long *)(*os_context_pc_addr(context)); + pc = (unsigned int *)(*os_context_pc_addr(context)); /* On the sparc, we have to decode the instruction. */ @@ -105,30 +105,47 @@ void arch_set_pseudo_atomic_interrupted(os_context_t *context) *os_context_register_addr(context,reg_ALLOC) |= 1; } -unsigned long arch_install_breakpoint(void *pc) +unsigned int arch_install_breakpoint(void *pc) { - unsigned long *ptr = (unsigned long *)pc; - unsigned long result = *ptr; + unsigned int *ptr = (unsigned int *)pc; + unsigned int result = *ptr; *ptr = trap_Breakpoint; - os_flush_icache((os_vm_address_t) pc, sizeof(unsigned long)); + os_flush_icache((os_vm_address_t) pc, sizeof(unsigned int)); return result; } -void arch_remove_breakpoint(void *pc, unsigned long orig_inst) +void arch_remove_breakpoint(void *pc, unsigned int orig_inst) { - *(unsigned long *)pc = orig_inst; - os_flush_icache((os_vm_address_t) pc, sizeof(unsigned long)); + *(unsigned int *)pc = orig_inst; + os_flush_icache((os_vm_address_t) pc, sizeof(unsigned int)); } -static unsigned long *skipped_break_addr, displaced_after_inst; +/* + * Perform the instruction that we overwrote with a breakpoint. As we + * don't have a single-step facility, this means we have to: + * - put the instruction back + * - put a second breakpoint at the following instruction, + * set after_breakpoint and continue execution. + * + * When the second breakpoint is hit (very shortly thereafter, we hope) + * sigtrap_handler gets called again, but follows the AfterBreakpoint + * arm, which + * - puts a bpt back in the first breakpoint place (running across a + * breakpoint shouldn't cause it to be uninstalled) + * - replaces the second bpt with the instruction it was meant to be + * - carries on + * + * Clear? + */ +static unsigned int *skipped_break_addr, displaced_after_inst; static sigset_t orig_sigmask; void arch_do_displaced_inst(os_context_t *context, unsigned int orig_inst) { - unsigned long *pc = (unsigned long *)(*os_context_pc_addr(context)); - unsigned long *npc = (unsigned long *)(*os_context_npc_addr(context)); + unsigned int *pc = (unsigned int *)(*os_context_pc_addr(context)); + unsigned int *npc = (unsigned int *)(*os_context_npc_addr(context)); /* orig_sigmask = context->sigmask; sigemptyset(&context->sigmask); */ @@ -136,11 +153,11 @@ void arch_do_displaced_inst(os_context_t *context, unsigned int orig_inst) /* FILLBLOCKSET(&context->uc_sigmask);*/ *pc = orig_inst; - os_flush_icache((os_vm_address_t) pc, sizeof(unsigned long)); + os_flush_icache((os_vm_address_t) pc, sizeof(unsigned int)); skipped_break_addr = pc; displaced_after_inst = *npc; *npc = trap_AfterBreakpoint; - os_flush_icache((os_vm_address_t) npc, sizeof(unsigned long)); + os_flush_icache((os_vm_address_t) npc, sizeof(unsigned int)); } @@ -227,10 +244,11 @@ static void sigill_handler(int signal, siginfo_t *siginfo, void *void_context) case trap_AfterBreakpoint: *skipped_break_addr = trap_Breakpoint; + os_flush_icache(skipped_break_addr, sizeof(unsigned int)); skipped_break_addr = NULL; *(unsigned long *) os_context_pc_addr(context) = displaced_after_inst; /* context->sigmask = orig_sigmask; */ - os_flush_icache((os_vm_address_t) os_context_pc_addr(context), sizeof(unsigned long)); + os_flush_icache((os_vm_address_t) os_context_pc_addr(context), sizeof(unsigned int)); break; default: @@ -263,7 +281,7 @@ static void sigill_handler(int signal, siginfo_t *siginfo, void *void_context) static void sigemt_handler(int signal, siginfo_t *siginfo, void *void_context) { - unsigned long badinst; + unsigned int badinst; boolean subtract, immed; int rd, rs1, op1, rs2, op2, result; os_context_t *context = arch_os_get_context(&void_context); @@ -271,7 +289,7 @@ static void sigemt_handler(int signal, siginfo_t *siginfo, void *void_context) os_restore_fp_control(context); #endif - badinst = *(unsigned long *)os_context_pc_addr(context); + badinst = *(unsigned int *)os_context_pc_addr(context); if ((badinst >> 30) != 2 || ((badinst >> 20) & 0x1f) != 0x11) { /* It wasn't a tagged add. Pass the signal into lisp. */ interrupt_handle_now(signal, siginfo, context); diff --git a/src/runtime/x86-64-arch.c b/src/runtime/x86-64-arch.c index ee8f6c6..5f10060 100644 --- a/src/runtime/x86-64-arch.c +++ b/src/runtime/x86-64-arch.c @@ -130,10 +130,10 @@ arch_set_pseudo_atomic_interrupted(os_context_t *context) * This stuff seems to get called for TRACE and debug activity. */ -unsigned long +unsigned int arch_install_breakpoint(void *pc) { - unsigned long result = *(unsigned long*)pc; + unsigned int result = *(unsigned int*)pc; *(char*)pc = BREAKPOINT_INST; /* x86 INT3 */ *((char*)pc+1) = trap_Breakpoint; /* Lisp trap code */ @@ -142,7 +142,7 @@ arch_install_breakpoint(void *pc) } void -arch_remove_breakpoint(void *pc, unsigned long orig_inst) +arch_remove_breakpoint(void *pc, unsigned int orig_inst) { *((char *)pc) = orig_inst & 0xff; *((char *)pc + 1) = (orig_inst & 0xff00) >> 8; @@ -150,7 +150,7 @@ arch_remove_breakpoint(void *pc, unsigned long orig_inst) /* When single stepping, single_stepping holds the original instruction * PC location. */ -unsigned long *single_stepping = NULL; +unsigned int *single_stepping = NULL; #ifdef CANNOT_GET_TO_SINGLE_STEP_FLAG unsigned long single_step_save1; unsigned long single_step_save2; @@ -160,7 +160,7 @@ unsigned long single_step_save3; void arch_do_displaced_inst(os_context_t *context, unsigned int orig_inst) { - unsigned long *pc = (unsigned long*)(*os_context_pc_addr(context)); + unsigned int *pc = (unsigned int*)(*os_context_pc_addr(context)); /* Put the original instruction back. */ *((char *)pc) = orig_inst & 0xff; @@ -179,7 +179,7 @@ arch_do_displaced_inst(os_context_t *context, unsigned int orig_inst) *context_eflags_addr(context) |= 0x100; #endif - single_stepping = (unsigned int*)pc; + single_stepping = pc; #ifdef CANNOT_GET_TO_SINGLE_STEP_FLAG *os_context_pc_addr(context) = (char *)pc - 9; diff --git a/src/runtime/x86-arch.c b/src/runtime/x86-arch.c index 8fba683..5b330ac 100644 --- a/src/runtime/x86-arch.c +++ b/src/runtime/x86-arch.c @@ -131,10 +131,10 @@ arch_set_pseudo_atomic_interrupted(os_context_t *context) * This stuff seems to get called for TRACE and debug activity. */ -unsigned long +unsigned int arch_install_breakpoint(void *pc) { - unsigned long result = *(unsigned long*)pc; + unsigned int result = *(unsigned int*)pc; *(char*)pc = BREAKPOINT_INST; /* x86 INT3 */ *((char*)pc+1) = trap_Breakpoint; /* Lisp trap code */ @@ -143,7 +143,7 @@ arch_install_breakpoint(void *pc) } void -arch_remove_breakpoint(void *pc, unsigned long orig_inst) +arch_remove_breakpoint(void *pc, unsigned int orig_inst) { *((char *)pc) = orig_inst & 0xff; *((char *)pc + 1) = (orig_inst & 0xff00) >> 8; @@ -180,7 +180,7 @@ arch_do_displaced_inst(os_context_t *context, unsigned int orig_inst) *context_eflags_addr(context) |= 0x100; #endif - single_stepping = (unsigned int*)pc; + single_stepping = pc; #ifdef CANNOT_GET_TO_SINGLE_STEP_FLAG *os_context_pc_addr(context) = (char *)pc - 9; diff --git a/version.lisp-expr b/version.lisp-expr index 7b33385..1fee710 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.5" +"0.9.5.1" -- 1.7.10.4