Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] gdb/win32-nat.c Step the correct thread
@ 2007-11-29 15:45 Pierre Muller
  2007-12-02  2:46 ` Christopher Faylor
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Muller @ 2007-11-29 15:45 UTC (permalink / raw)
  To: gdb-patches

  While trying to understand the SuspendThread
counting problems, I tried to single step after changing 
thread, and I noticed that the next event always 
brought me back to the main thread.

  There is a bug in the current win32-nat.c source
which places the trace bit always in the
main thread, while we should step the thread identified by 
inferior_ptid.

  This simple patch corrects this.

The testsuite runs with and without this patch
show no difference.

OK to check in?


2007-11-29  Pierre Muller  <muller@ics.u-strasbg.fr>

	* win32-nat.c (win32_resume): Set the trace bit
	in the thread identified by inferior_ptid.

Index: gdb/win32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.140
diff -u -p -r1.140 win32-nat.c
--- gdb/win32-nat.c     24 Nov 2007 12:13:28 -0000      1.140
+++ gdb/win32-nat.c     29 Nov 2007 13:52:18 -0000
@@ -1225,7 +1225,7 @@ win32_resume (ptid_t ptid, int step, enu
               pid, step, sig));

   /* Get context for currently selected thread */
-  th = thread_rec (current_event.dwThreadId, FALSE);
+  th = thread_rec (PIDGET (inferior_ptid), FALSE);
   if (th)
     {
       if (step)



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

* Re: [RFA] gdb/win32-nat.c Step the correct thread
  2007-11-29 15:45 [RFA] gdb/win32-nat.c Step the correct thread Pierre Muller
@ 2007-12-02  2:46 ` Christopher Faylor
  2007-12-02 21:53   ` Pierre Muller
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Faylor @ 2007-12-02  2:46 UTC (permalink / raw)
  To: gdb-patches, Pierre Muller

On Thu, Nov 29, 2007 at 04:45:17PM +0100, Pierre Muller wrote:
>  While trying to understand the SuspendThread
>counting problems, I tried to single step after changing 
>thread, and I noticed that the next event always 
>brought me back to the main thread.
>
>  There is a bug in the current win32-nat.c source
>which places the trace bit always in the
>main thread, while we should step the thread identified by 
>inferior_ptid.
>
>  This simple patch corrects this.
>
>The testsuite runs with and without this patch
>show no difference.
>
>OK to check in?

Ok.

cgf


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

* RE: [RFA] gdb/win32-nat.c Step the correct thread
  2007-12-02  2:46 ` Christopher Faylor
@ 2007-12-02 21:53   ` Pierre Muller
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre Muller @ 2007-12-02 21:53 UTC (permalink / raw)
  To: gdb-patches



> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Christopher Faylor
> Sent: Sunday, December 02, 2007 3:46 AM
> To: gdb-patches@sourceware.org; Pierre Muller
> Subject: Re: [RFA] gdb/win32-nat.c Step the correct thread
> 
> On Thu, Nov 29, 2007 at 04:45:17PM +0100, Pierre Muller wrote:
> >  While trying to understand the SuspendThread
> >counting problems, I tried to single step after changing
> >thread, and I noticed that the next event always
> >brought me back to the main thread.
> >
> >  There is a bug in the current win32-nat.c source
> >which places the trace bit always in the
> >main thread, while we should step the thread identified by
> >inferior_ptid.
> >
> >  This simple patch corrects this.
> >
> >The testsuite runs with and without this patch
> >show no difference.
> >
> >OK to check in?
> 
> Ok.
Thanks, applied.

  I am preparing a patch that 
will get the win32 port of gdb to
honor the
set schechuler-locking on
which stipulates that only the stepped thread
will be allowed to executed and all other threads
are suspended.
  The only problem is that I need to reintroduce 
the suspend_count field in thread_info record
for that to work.

Pierre





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

end of thread, other threads:[~2007-12-02 21:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-29 15:45 [RFA] gdb/win32-nat.c Step the correct thread Pierre Muller
2007-12-02  2:46 ` Christopher Faylor
2007-12-02 21:53   ` Pierre Muller

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