From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84056 invoked by alias); 16 Apr 2015 19:23:52 -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 83543 invoked by uid 89); 16 Apr 2015 19:23:52 -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:23:50 +0000 X-OWM-Source-IP: 31.51.207.104(GB) X-OWM-Env-Sender: jonturney@btinternet.com X-CTCH-RefID: str=0001.0A090202.55300C44.0063,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, __SUBJ_ALPHA_NEGATE, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_2000_2999, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, 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_7000_LESS, NO_URI_FOUND, 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 5515161402614804; Thu, 16 Apr 2015 20:23:48 +0100 From: Jon Turney To: gdb-patches@sourceware.org Cc: Jon Turney Subject: [PATCH 0/5] Fix to Cygwin-specific signal handling (v2) Date: Thu, 16 Apr 2015 19:23:00 -0000 Message-Id: <1429212209-20548-1-git-send-email-jon.turney@dronecode.org.uk> In-Reply-To: <1429009382-21040-1-git-send-email-jon.turney@dronecode.org.uk> References: <1429009382-21040-1-git-send-email-jon.turney@dronecode.org.uk> X-SW-Source: 2015-04/txt/msg00628.txt.bz2 Some cleanups in windows-nat.c and a fix to Cygwin-specific signal handling. Using the 'catch-signal' test from the testsuite, on x86_64 Cygwin: $ ./gdb testsuite/outputs/gdb.base/catch-signal/catch-signal.exe [...] (gdb) catch signal Catchpoint 1 (standard signals) (gdb) r [...] Catchpoint 1 (signal SIGHUP), main () at ../../../gdb/testsuite/gdb.base/catch-signal.c:40 40 raise (SIGHUP); /* second HUP */ (gdb) c Continuing. [hangs] with up to [4/5] applied: $ ./gdb testsuite/outputs/gdb.base/catch-signal/catch-signal.exe [...] (gdb) catch signal Catchpoint 1 (standard signals) (gdb) r [...] Catchpoint 1 (signal SIGHUP), main () at ../../../gdb/testsuite/gdb.base/catch-signal.c:40 40 raise (SIGHUP); /* second HUP */ (gdb) c Continuing. main () at ../../../gdb/testsuite/gdb.base/catch-signal.c:40 40 raise (SIGHUP); /* second HUP */ ContinueDebugEvent failed, GetLastError = 87 (gdb) It can be seen that changing current_event.dwThreadId as handle_output_debug_string does when processing a Cygwin signal message, leads to ContinueDebugEvent() being applied to the wrong thead, with tragic consequences. with [5/5] applied: $ ./gdb testsuite/outputs/gdb.base/catch-signal/catch-signal.exe [...] (gdb) catch signal Catchpoint 1 (standard signals) (gdb) r [...] Catchpoint 1 (signal SIGHUP), main () at ../../../gdb/testsuite/gdb.base/catch-signal.c:40 40 raise (SIGHUP); /* second HUP */ (gdb) c Continuing. Catchpoint 1 (signal SIGHUP), main () at ../../../gdb/testsuite/gdb.base/catch-signal.c:42 42 raise (SIGHUP); /* third HUP */ (gdb) It looks like tests don't finish with an unresponsive gdb, and there are more tests in the testsuite which have this problem than my computer has cores, so eventually it ends up stuck on those tests, and the test run doesn't finish. After these patches, there still remain some problems with Cygwin-specific signal handling, which hopefully I can address in future patches. Jon Turney (5): windows-nat: Don't use ternary conditional operator in get_windows_debug_event windows-nat: Cleanups in get_windows_debug_event windows-nat: Fix misspelling in debug output windows-nat: Report an error if ContinueDebugEvent() fails windows-nat: Don't change current_event.dwThreadId in handle_output_debug_string() gdb/ChangeLog | 26 ++++++++++++++++++++++++++ gdb/windows-nat.c | 41 +++++++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 18 deletions(-) -- 2.1.4