aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-nlmstub.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1993-09-10 23:25:40 +0000
committerIan Lance Taylor <ian@airs.com>1993-09-10 23:25:40 +0000
commitd6a99838742b10f879e31557c4c7effe21b2d47e (patch)
treea3ba002ed507250b86b39747b09e9c311a45ffea /gdb/i386-nlmstub.c
parentbccf35217ec654fa4942c2e535195d7d13d238b8 (diff)
downloadgdb-d6a99838742b10f879e31557c4c7effe21b2d47e.zip
gdb-d6a99838742b10f879e31557c4c7effe21b2d47e.tar.gz
gdb-d6a99838742b10f879e31557c4c7effe21b2d47e.tar.bz2
Snapshot of current i386 NLM debugging stub.
Diffstat (limited to 'gdb/i386-nlmstub.c')
-rw-r--r--gdb/i386-nlmstub.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gdb/i386-nlmstub.c b/gdb/i386-nlmstub.c
index 5604ed6..c9bcaf1 100644
--- a/gdb/i386-nlmstub.c
+++ b/gdb/i386-nlmstub.c
@@ -243,9 +243,6 @@ struct LoadDefinitionStructure
/* The main thread ID. */
static int mainthread;
-/* The debug server thread ID. */
-static int debugthread;
-
/* The LoadDefinitionStructure of the NLM being debugged. */
static struct LoadDefinitionStructure *handle;
@@ -720,13 +717,18 @@ handle_exception (T_StackFrame *old_frame)
if (frame->ExceptionNumber == START_NLM_EVENT
&& handle == NULL)
{
- debugthread = GetThreadID ();
handle = (struct LoadDefinitionStructure *) frame->ExceptionErrorCode;
first_insn = *(char *) handle->LDInitializationProcedure;
*(unsigned char *) handle->LDInitializationProcedure = 0xcc;
return RETURN_TO_PROGRAM;
}
+ /* Pass some events on to the next debugger, in case it will handle
+ them. */
+ if (frame->ExceptionNumber == ENTER_DEBUGGER_EVENT
+ || frame->ExceptionNumber == KEYBOARD_BREAK_EVENT)
+ return RETURN_TO_NEXT_DEBUGGER;
+
/* At the moment, we don't care about most of the unusual NetWare
exceptions. */
if (frame->ExceptionNumber != TERMINATE_NLM_EVENT
@@ -1040,12 +1042,12 @@ main (argc, argv)
exit (1);
}
- /* By the time we reach this point in the code the debugger thread
- should have received a START_NLM_EVENT and gone to sleep. */
+ /* Wait for the debugger to wake us up. */
if (remote_debug > 0)
- ConsolePrintf ("Resuming %d, suspending %d\r\n", debugthread, mainthread);
- ResumeThread (debugthread);
+ ConsolePrintf ("Suspending main thread (%d)\r\n", mainthread);
SuspendThread (mainthread);
+ if (remote_debug > 0)
+ ConsolePrintf ("Resuming main thread (%d)\r\n", mainthread);
/* If we are woken up, print an optional error message, deregister
ourselves and exit. */