diff options
author | J.T. Conklin <jtc@acorntoolworks.com> | 1994-08-08 22:14:06 +0000 |
---|---|---|
committer | J.T. Conklin <jtc@acorntoolworks.com> | 1994-08-08 22:14:06 +0000 |
commit | ac2068375f4e37bd1976fb34595a28cdd6fdfa68 (patch) | |
tree | dc283ad194b625168922e1c7cfe7c5f6547f50be /gdb/i386-nlmstub.c | |
parent | 9623e82883dc76faad2efde88a1d5a8f17955da2 (diff) | |
download | gdb-ac2068375f4e37bd1976fb34595a28cdd6fdfa68.zip gdb-ac2068375f4e37bd1976fb34595a28cdd6fdfa68.tar.gz gdb-ac2068375f4e37bd1976fb34595a28cdd6fdfa68.tar.bz2 |
* i386-nlmstub.c (handle_exception): Wait until the thread has
been started before killing the NLM by pointing the PC at
_exit().
Diffstat (limited to 'gdb/i386-nlmstub.c')
-rw-r--r-- | gdb/i386-nlmstub.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/gdb/i386-nlmstub.c b/gdb/i386-nlmstub.c index 1d0c9d6..109aa14 100644 --- a/gdb/i386-nlmstub.c +++ b/gdb/i386-nlmstub.c @@ -627,7 +627,8 @@ handle_exception (frame) { int addr, length; char *ptr; - static int killed = 0; + static int thread_killed = 0; + static int thread_started = 0; static struct DBG_LoadDefinitionStructure *ldinfo = 0; static unsigned char first_insn[BREAKPOINT_SIZE]; /* The first instruction in the program. */ @@ -661,8 +662,12 @@ handle_exception (frame) flush_i_cache (); return RETURN_TO_PROGRAM; + case START_THREAD_EVENT: + thread_started = 1; + return RETURN_TO_PROGRAM; + case TERMINATE_NLM_EVENT: - if (!killed) + if (!thread_killed) { /* NetWare processes don't have an exit status so we generate our own */ @@ -731,6 +736,14 @@ handle_exception (frame) break; } + /* We point the PC at _exit() and continue to kill the NLM, but that + won't work until it's thread has been started. */ + if (thread_started && thread_killed) + { + frame->ExceptionPC = &_exit; + return RETURN_TO_PROGRAM; + } + /* FIXME: How do we know that this exception has anything to do with the program we are debugging? We can check whether the PC is in the range of the module we are debugging, but that doesn't help @@ -850,8 +863,9 @@ handle_exception (frame) at the start of _exit() and continue, while noting that we've killed the process. */ - killed = 1; - frame->ExceptionPC = &_exit; + thread_killed = 1; + if (thread_started) + frame->ExceptionPC = &_exit; return RETURN_TO_PROGRAM; case 'q': /* Query message */ |