From: Jon Turney <jon.turney@dronecode.org.uk>
To: gdb-patches@sourceware.org
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH 0/5] Fix to Cygwin-specific signal handling (v2)
Date: Thu, 16 Apr 2015 19:23:00 -0000 [thread overview]
Message-ID: <1429212209-20548-1-git-send-email-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <1429009382-21040-1-git-send-email-jon.turney@dronecode.org.uk>
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
next prev parent reply other threads:[~2015-04-16 19:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-14 11:03 [PATCH] Fixes to Cygwin-specific signal handling Jon Turney
2015-04-14 13:16 ` Joel Brobecker
2015-04-14 14:38 ` Eli Zaretskii
2015-04-16 19:24 ` Jon TURNEY
2015-04-22 14:23 ` Joel Brobecker
2015-04-16 19:23 ` Jon Turney [this message]
2015-04-16 19:23 ` [PATCH 2/5] windows-nat: Cleanups in get_windows_debug_event Jon Turney
2015-04-22 13:52 ` Joel Brobecker
2015-04-16 19:24 ` [PATCH 4/5] windows-nat: Report an error if ContinueDebugEvent() fails Jon Turney
2015-04-22 14:10 ` Joel Brobecker
2015-04-16 19:24 ` [PATCH 1/5] windows-nat: Don't use ternary conditional operator in get_windows_debug_event Jon Turney
2015-04-22 13:50 ` Joel Brobecker
2015-04-16 19:24 ` [PATCH 3/5] windows-nat: Fix misspelling in debug output Jon Turney
2015-04-22 13:55 ` Joel Brobecker
2015-04-16 19:24 ` [PATCH 5/5] windows-nat: Don't change current_event.dwThreadId in handle_output_debug_string() Jon Turney
2015-04-22 14:18 ` Joel Brobecker
2015-06-10 13:06 ` [PATCH 0/5] Fix to Cygwin-specific signal handling (v2) Jon TURNEY
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1429212209-20548-1-git-send-email-jon.turney@dronecode.org.uk \
--to=jon.turney@dronecode.org.uk \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox