From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5520 invoked by alias); 29 Nov 2007 15:45:33 -0000 Received: (qmail 5509 invoked by uid 22791); 29 Nov 2007 15:45:32 -0000 X-Spam-Check-By: sourceware.org Received: from ics.u-strasbg.fr (HELO ics.u-strasbg.fr) (130.79.112.250) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 29 Nov 2007 15:45:25 +0000 Received: from ICSMULLER (laocoon.u-strasbg.fr [130.79.112.72]) by ics.u-strasbg.fr (Postfix) with ESMTP id 86BE818701D for ; Thu, 29 Nov 2007 16:49:50 +0100 (CET) From: "Pierre Muller" To: Subject: [RFA] gdb/win32-nat.c Step the correct thread Date: Thu, 29 Nov 2007 15:45:00 -0000 Message-ID: <002801c8329e$d726e090$8574a1b0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-11/txt/msg00546.txt.bz2 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 * 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)