From: Daniel Jacobowitz <drow@false.org>
To: Denis PILAT <denis.pilat@st.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFA] gdbserver with reversed arguments seg. fault
Date: Wed, 03 Jan 2007 17:58:00 -0000 [thread overview]
Message-ID: <20070103175838.GA17935@nevyn.them.org> (raw)
In-Reply-To: <459B778D.4000500@st.com>
On Wed, Jan 03, 2007 at 10:29:49AM +0100, Denis PILAT wrote:
> 2007-01-03 Denis Pilat <denis.pilat@st.com>
>
> * linux-low.c (linux_kill): handle the null case of all_threads.head.
Thanks, I see what happened now. I've committed this version. Please
avoid format=flowed patches in the future - it was pretty mangled.
--
Daniel Jacobowitz
CodeSourcery
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.
Index: linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.48
diff -u -p -r1.48 linux-low.c
--- linux-low.c 16 Nov 2006 15:08:25 -0000 1.48
+++ linux-low.c 3 Jan 2007 17:53:31 -0000
@@ -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);
Index: win32-i386-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/win32-i386-low.c,v
retrieving revision 1.1
diff -u -p -r1.1 win32-i386-low.c
--- win32-i386-low.c 23 Jul 2006 03:52:15 -0000 1.1
+++ win32-i386-low.c 3 Jan 2007 17:53:31 -0000
@@ -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;
prev parent reply other threads:[~2007-01-03 17:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-03 9:30 Denis PILAT
2007-01-03 14:44 ` Daniel Jacobowitz
2007-01-03 15:02 ` Denis PILAT
2007-01-03 17:58 ` Daniel Jacobowitz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070103175838.GA17935@nevyn.them.org \
--to=drow@false.org \
--cc=denis.pilat@st.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox