aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-01-03 17:57:16 +0000
committerDaniel Jacobowitz <drow@false.org>2007-01-03 17:57:16 +0000
commit9d6063994fbb0f0ec4fb8005f18bc84768592368 (patch)
tree585c0fa25b157dc16cbccb9dc0df5f1cd43d7fb0 /gdb
parent61a771aa2e37ad529478386d7c18840d3696c9aa (diff)
downloadfsf-binutils-gdb-9d6063994fbb0f0ec4fb8005f18bc84768592368.zip
fsf-binutils-gdb-9d6063994fbb0f0ec4fb8005f18bc84768592368.tar.gz
fsf-binutils-gdb-9d6063994fbb0f0ec4fb8005f18bc84768592368.tar.bz2
* linux-low.c (linux_kill): Handle being called with no threads.
* win32-i386-low.c (win32_kill): Likewise. (get_child_debug_event): Clear current_process_handle.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/gdbserver/ChangeLog9
-rw-r--r--gdb/gdbserver/linux-low.c6
-rw-r--r--gdb/gdbserver/win32-i386-low.c4
3 files changed, 17 insertions, 2 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index d2b7d3b..2035473 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,4 +1,11 @@
-2006-12-30 Denis PILAT <denis.pilat@st.com>
+2007-01-03 Denis Pilat <denis.pilat@st.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+
+ * linux-low.c (linux_kill): Handle being called with no threads.
+ * win32-i386-low.c (win32_kill): Likewise.
+ (get_child_debug_event): Clear current_process_handle.
+
+2006-12-30 Denis PILAT <denis.pilat@st.com>
Daniel Jacobowitz <dan@codesourcery.com>
* remote-utils.c (remote_open): Check the type of specified
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 83a56aa..64273b5 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -255,13 +255,17 @@ static void
linux_kill (void)
{
struct thread_info *thread = (struct thread_info *) all_threads.head;
- struct process_info *process = get_thread_process (thread);
+ struct process_info *process;
int wstat;
+ if (thread == NULL)
+ return;
+
for_each_inferior (&all_threads, linux_kill_one_process);
/* See the comment in linux_kill_one_process. We did not kill the first
thread in the list, so do so now. */
+ process = get_thread_process (thread);
do
{
ptrace (PTRACE_KILL, pid_of (process), 0, 0);
diff --git a/gdb/gdbserver/win32-i386-low.c b/gdb/gdbserver/win32-i386-low.c
index de6ef0b..ee2d2d1 100644
--- a/gdb/gdbserver/win32-i386-low.c
+++ b/gdb/gdbserver/win32-i386-low.c
@@ -582,6 +582,9 @@ win32_attach (unsigned long pid)
static void
win32_kill (void)
{
+ if (current_process_handle == NULL)
+ return;
+
TerminateProcess (current_process_handle, 0);
for (;;)
{
@@ -901,6 +904,7 @@ in:
ourstatus->kind = TARGET_WAITKIND_EXITED;
ourstatus->value.integer = current_event.u.ExitProcess.dwExitCode;
CloseHandle (current_process_handle);
+ current_process_handle = NULL;
retval = main_thread_id;
break;