diff --git a/lisp/x86-arch.c b/lisp/x86-arch.c index 1c87c1b970ae6dc40d9b7bfe1ecce892060cb695..90ff96b8a982c3fd68f20be7eeb4127e6cb07322 100644 --- a/lisp/x86-arch.c +++ b/lisp/x86-arch.c @@ -1,6 +1,6 @@ /* x86-arch.c -*- Mode: C; comment-column: 40 -*- * - * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/x86-arch.c,v 1.40 2010/12/22 02:12:52 rtoy Exp $ + * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/x86-arch.c,v 1.41 2010/12/23 22:23:48 rtoy Exp $ * */ @@ -250,6 +250,8 @@ arch_do_displaced_inst(os_context_t * context, unsigned long orig_inst) * single-stepping and stop on the next instruction. */ + DFPRINTF(0, (stderr, "Installing helper instructions\n")); + single_step_save1 = *(pc - 3); single_step_save2 = *(pc - 2); single_step_save3 = *(pc - 1); @@ -260,12 +262,13 @@ arch_do_displaced_inst(os_context_t * context, unsigned long orig_inst) single_stepping = (unsigned int *) pc; -#if !(defined(__linux__) || defined(DARWIN)) +#ifndef SC_EFLAGS /* * pc - 9 points to the pushf instruction that we installed for * the helper. */ + DFPRINTF(0, (stderr, " Setting pc to pushf instruction at %p\n", (void*) ((char*) pc - 9))); SC_PC(context) = (int)((char *) pc - 9); #endif } @@ -277,8 +280,8 @@ sigtrap_handler(HANDLER_ARGS) unsigned int trap; #if 0 - fprintf(stderr, "x86sigtrap: %8x %x\n", - SC_PC(context), *(unsigned char *) (SC_PC(context) - 1)); + fprintf(stderr, "x86sigtrap: %8x %x\n", + SC_PC(context), *(unsigned char *) (SC_PC(context) - 1)); fprintf(stderr, "sigtrap(%d %d %x)\n", signal, CODE(code), context); #endif @@ -295,6 +298,7 @@ sigtrap_handler(HANDLER_ARGS) *(single_stepping - 3) = single_step_save1; *(single_stepping - 2) = single_step_save2; *(single_stepping - 1) = single_step_save3; + DFPRINTF(0, (stderr, "Uninstalling helper instructions\n")); #endif /* diff --git a/lisp/x86-lispregs.h b/lisp/x86-lispregs.h index 0e9735e241e0a0f27361441a4411f22df426be20..863740924088bb584e0a61f233ec500311bcca58 100644 --- a/lisp/x86-lispregs.h +++ b/lisp/x86-lispregs.h @@ -1,5 +1,5 @@ /* x86-lispregs.h -*- Mode: C; -*- - * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/x86-lispregs.h,v 1.13 2008/12/29 14:40:34 rtoy Rel $ + * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/x86-lispregs.h,v 1.14 2010/12/23 22:23:48 rtoy Exp $ */ #ifndef _X86_LISPREGS_H_ @@ -58,6 +58,8 @@ #endif #elif defined(__linux__) #define SC_EFLAGS(sc) ((sc)->uc_mcontext.gregs[REG_EFL]) +#elif defined(__NetBSD__) +#define SC_EFLAGS(sc) ((sc)->uc_mcontext.__gregs[_REG_EFL]) #endif #endif /* _X86_LISPREGS_H_ */