* [RFA] * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
@ 2008-12-12 20:07 Doug Evans
2008-12-12 20:47 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: Doug Evans @ 2008-12-12 20:07 UTC (permalink / raw)
To: gdb-patches
Hi.
linux-low.c:linux_wait_for_process has this:
if (debug_threads
&& WIFSTOPPED (*wstatp))
{
current_inferior = (struct thread_info *)
find_inferior_id (&all_threads, (*childp)->lwpid);
/* For testing only; i386_stop_pc prints out a diagnostic. */
if (the_low_target.get_pc != NULL)
get_stop_pc ();
}
Clobbering current_inferior in a debugging printf is asking for trouble.
[If current_inferior is supposed to be changed here, let's move it
outside the test for debug_threads.]
Ok to check in?
2008-12-12 Doug Evans <dje@google.com>
* linux-low.c (linux_wait_for_process): Don't clobber current_inferior
in debugging printf.
Index: linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.82
diff -u -p -r1.82 linux-low.c
--- linux-low.c 2 Dec 2008 07:57:37 -0000 1.82
+++ linux-low.c 12 Dec 2008 20:03:34 -0000
@@ -643,11 +642,13 @@ retry:
if (debug_threads
&& WIFSTOPPED (*wstatp))
{
+ struct thread_info *saved_inferior = current_inferior;
current_inferior = (struct thread_info *)
find_inferior_id (&all_threads, (*childp)->lwpid);
/* For testing only; i386_stop_pc prints out a diagnostic. */
if (the_low_target.get_pc != NULL)
get_stop_pc ();
+ current_inferior = saved_inferior;
}
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFA] * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
2008-12-12 20:07 [RFA] * linux-low.c (linux_wait_for_process): Don't clobber current_inferior Doug Evans
@ 2008-12-12 20:47 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2008-12-12 20:47 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
On Fri, Dec 12, 2008 at 12:07:10PM -0800, Doug Evans wrote:
> 2008-12-12 Doug Evans <dje@google.com>
>
> * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
> in debugging printf.
OK.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-12-12 20:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-12 20:07 [RFA] * linux-low.c (linux_wait_for_process): Don't clobber current_inferior Doug Evans
2008-12-12 20:47 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox