From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85617 invoked by alias); 16 Apr 2015 19:24:04 -0000 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 Received: (qmail 85503 invoked by uid 89); 16 Apr 2015 19:24:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 X-HELO: rgout06.bt.lon5.cpcloud.co.uk Received: from rgout06.bt.lon5.cpcloud.co.uk (HELO rgout06.bt.lon5.cpcloud.co.uk) (65.20.0.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 16 Apr 2015 19:24:02 +0000 X-OWM-Source-IP: 31.51.207.104(GB) X-OWM-Env-Sender: jonturney@btinternet.com X-CTCH-RefID: str=0001.0A090204.55300C52.0019,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-Junkmail-Premium-Raw: score=27/50,refid=2.7.2:2015.3.30.162421:17:27.888,ip=31.51.207.104,rules=__HAS_FROM, __TO_MALFORMED_2, __TO_NO_NAME, __HAS_MSGID, __SANE_MSGID, __HAS_X_MAILER, __IN_REP_TO, __REFERENCES, __ANY_URI, __URI_NO_WWW, __URI_NO_PATH, __CP_NOT_1, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_1400_1499, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, __URI_NS, SXL_IP_DYNAMIC[104.207.51.31.fur], HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, RDNS_SUSP_GENERIC, RDNS_SUSP, BODY_SIZE_2000_LESS, BODY_SIZE_7000_LESS, REFERENCES X-CTCH-Spam: Unknown Received: from localhost.localdomain (31.51.207.104) by rgout06.bt.lon5.cpcloud.co.uk (8.6.122.06) (authenticated as jonturney@btinternet.com) id 5515161402614974; Thu, 16 Apr 2015 20:24:02 +0100 From: Jon Turney To: gdb-patches@sourceware.org Cc: Jon Turney Subject: [PATCH 5/5] windows-nat: Don't change current_event.dwThreadId in handle_output_debug_string() Date: Thu, 16 Apr 2015 19:24:00 -0000 Message-Id: <1429212209-20548-6-git-send-email-jon.turney@dronecode.org.uk> In-Reply-To: <1429212209-20548-1-git-send-email-jon.turney@dronecode.org.uk> References: <1429009382-21040-1-git-send-email-jon.turney@dronecode.org.uk> <1429212209-20548-1-git-send-email-jon.turney@dronecode.org.uk> X-SW-Source: 2015-04/txt/msg00631.txt.bz2 Since a Cygwin signal may be reported by a different thread to the thread the signal is to be delivered to, use the signal target thread id by returning it, rather than re-writing the thread id in current_event. Altering current_event.dwThreadId() will cause ContinueDebugEvent() to be applied to the wrong thread and fail, leaving the actual thread which reported the debug event stuck in the suspended state. gdb/ChangeLog: 2015-04-16 Jon Turney * windows-nat.c (handle_output_debug_string): Don't change current_event.dwThreadId. (get_windows_debug_event): Use thread_id, rather than relying on current_event.dwThreadId being changed. --- gdb/ChangeLog | 7 +++++++ gdb/windows-nat.c | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 94d295e..9a4276e 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -850,7 +850,6 @@ handle_output_debug_string (struct target_waitstatus *ourstatus) __COPY_CONTEXT_SIZE, &n) && n == __COPY_CONTEXT_SIZE) have_saved_context = 1; - current_event.dwThreadId = retval; } } #endif @@ -1508,7 +1507,7 @@ get_windows_debug_event (struct target_ops *ops, thread_id); current_thread = th; if (!current_thread) - current_thread = thread_rec (current_event.dwThreadId, TRUE); + current_thread = thread_rec (thread_id, TRUE); } out: -- 2.1.4