From: Denis PILAT <denis.pilat@st.com>
To: gdb-patches <gdb-patches@sourceware.org>
Subject: [RFA] gdbserver with reversed arguments seg. fault
Date: Wed, 03 Jan 2007 09:30:00 -0000 [thread overview]
Message-ID: <459B778D.4000500@st.com> (raw)
Hi,
Following our discussion in the thread
http://sources.redhat.com/ml/gdb-patches/2007-01/msg00059.html
I'm proposing the attached patch to fix a segmentation fault that occurs
into gdbserver when you revert the binary filename with the "host:port"
argument.
In inferiors.c the inferior_target_data() function is called with a NULL
pointer argument. At the beginning I though of testing arguments but
none of them are tested in this whole file so I concluded it's up to the
caller to do so.
(I hope this time my patch is related to a version nearer from the HEAD :)
Denis
--
2007-01-03 Denis Pilat <denis.pilat@st.com>
* linux-low.c (linux_kill): handle the null case of all_threads.head.
Index: linux-low.c
===================================================================
--- linux-low.c (revision 545)
+++ linux-low.c (working copy)
@@ -255,9 +255,13 @@ 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)
+ return;
+
+ process = get_thread_process (thread);
for_each_inferior (&all_threads, linux_kill_one_process);
/* See the comment in linux_kill_one_process. We did not kill the first
next reply other threads:[~2007-01-03 9:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-03 9:30 Denis PILAT [this message]
2007-01-03 14:44 ` Daniel Jacobowitz
2007-01-03 15:02 ` Denis PILAT
2007-01-03 17:58 ` Daniel Jacobowitz
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=459B778D.4000500@st.com \
--to=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