This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
i386-stub.c patch, remove exceptionHook cruft.
- To: gdb-patches@sourceware.cygnus.com
- Subject: i386-stub.c patch, remove exceptionHook cruft.
- From: jtc@redback.com (J.T. Conklin)
- Date: 01 Sep 1999 00:31:51 -0700
- Reply-To: jtc@redback.com
The enclosed patch removes the exceptionHook code inherited from the
m68k stub when this file was created. However, unlike the m68k stub,
support for the hook was never completed.
But what code there was required the user to define the exceptionHook
variable even though it would never be used. Since none of the other
stubs support such a hook, and I haven't needed anything like it in
the time I've been using the i386 stub, I decided to simply remove it.
--jtc
1999-09-01 J.T. Conklin <jtc@redback.com>
* i386-stub.c (exceptionHook, oldExceptionHook): Removed.
(handle_exception): Removed #if'd out exception hook code.
Index: i386-stub.c
===================================================================
RCS file: /home/jtc/CVSROOT/gdb/gdb/i386-stub.c,v
retrieving revision 1.8
diff -c -r1.8 i386-stub.c
*** i386-stub.c 1999/09/01 06:37:05 1.8
--- i386-stub.c 1999/09/01 06:49:27
***************
*** 43,49 ****
* It should use the same privilege level it runs at. It should
* install it as an interrupt gate so that interrupts are masked
* while the handler runs.
- * Also, need to assign exceptionHook and oldExceptionHook.
*
* Because gdb will sometimes write to the stack area to execute function
* calls, this program cannot rely on using the supervisor stack so it
--- 43,48 ----
***************
*** 97,110 ****
*
* external low-level support routines
*/
- typedef void (*ExceptionHook)(int); /* pointer to function with int parm */
- typedef void (*Function)(); /* pointer to a function */
extern void putDebugChar(); /* write a single character */
extern int getDebugChar(); /* read and return a single char */
!
! extern Function exceptionHandler(); /* assign an exception handler */
! extern ExceptionHook exceptionHook; /* hook variable for errors/exceptions */
/************************************************************************/
/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
--- 96,105 ----
*
* external low-level support routines
*/
extern void putDebugChar(); /* write a single character */
extern int getDebugChar(); /* read and return a single char */
! extern void exceptionHandler(); /* assign an exception handler */
/************************************************************************/
/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
***************
*** 138,151 ****
int remcomStack[STACKSIZE/sizeof(int)];
static int* stackPtr = &remcomStack[STACKSIZE/sizeof(int) - 1];
- /*
- * In many cases, the system will want to continue exception processing
- * when a continue command is given.
- * oldExceptionHook is a function to invoke in this case.
- */
-
- static ExceptionHook oldExceptionHook;
-
/*************************** ASSEMBLY CODE MACROS *************************/
/* */
--- 133,138 ----
***************
*** 836,860 ****
/* set the trace bit if we're stepping */
if (stepping) registers[ PS ] |= 0x100;
- /*
- * If we found a match for the PC AND we are not returning
- * as a result of a breakpoint (33),
- * trace exception (9), nmi (31), jmp to
- * the old exception handler as if this code never ran.
- */
- #if 0
- /* Don't really think we need this, except maybe for protection
- exceptions. */
- /*
- * invoke the previous handler.
- */
- if (oldExceptionHook)
- (*oldExceptionHook) (frame->exceptionVector);
- newPC = registers[ PC ]; /* pc may have changed */
- #endif /* 0 */
-
_returnFromException(); /* this is a jump */
-
break;
/* kill the program */
--- 823,829 ----
***************
*** 896,907 ****
exceptionHandler (13, _catchException13);
exceptionHandler (14, _catchException14);
exceptionHandler (16, _catchException16);
-
- if (exceptionHook != remcomHandler)
- {
- oldExceptionHook = exceptionHook;
- exceptionHook = remcomHandler;
- }
initialized = 1;
}
--- 865,870 ----
--
J.T. Conklin
RedBack Networks