Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] gdbserver with reversed arguments seg. fault
@ 2007-01-03  9:30 Denis PILAT
  2007-01-03 14:44 ` Daniel Jacobowitz
  2007-01-03 17:58 ` Daniel Jacobowitz
  0 siblings, 2 replies; 4+ messages in thread
From: Denis PILAT @ 2007-01-03  9:30 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-03 17:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-03  9:30 [RFA] gdbserver with reversed arguments seg. fault Denis PILAT
2007-01-03 14:44 ` Daniel Jacobowitz
2007-01-03 15:02   ` Denis PILAT
2007-01-03 17:58 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox