From patchwork Sun Jul 3 19:01:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 13606 Received: (qmail 20309 invoked by alias); 3 Jul 2016 19:01:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 20297 invoked by uid 89); 3 Jul 2016 19:01:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=HX-Greylist:succeeded, HX-Greylist:SMTP, HX-Greylist:AUTH, notifications X-HELO: bigwig.baldwin.cx Received: from bigwig.baldwin.cx (HELO bigwig.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Sun, 03 Jul 2016 19:01:46 +0000 Received: from ralph.com (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D8DB2B958 for ; Sun, 3 Jul 2016 15:01:43 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH] Pass SIGLIBRT directly to child processes. Date: Sun, 3 Jul 2016 12:01:01 -0700 Message-Id: <20160703190101.97715-1-jhb@FreeBSD.org> X-IsSubscribed: yes FreeBSD's librt uses SIGLIBRT as an internal signal to implement SIGEV_THREAD sigevent notifications. Similar to SIGLWP or SIGCANCEL this signal should be passed through to child processes by default. include/ChangeLog: * signals.def: Add GDB_SIGNAL_LIBRT. gdb/ChangeLog: * common/signals.c (gdb_signal_from_host): Handle SIGLIBRT. (do_gdb_signal_to_host): Likewise. * infrun.c (_initialize_infrun): Pass GDB_SIGNAL_LIBRT through to programs. * proc-events.c (signal_table): Add entry for SIGLIBRT. --- gdb/ChangeLog | 8 ++++++++ gdb/common/signals.c | 8 ++++++++ gdb/infrun.c | 2 ++ gdb/proc-events.c | 3 +++ include/gdb/ChangeLog | 4 ++++ include/gdb/signals.def | 4 +++- 6 files changed, 28 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 58c9c78..a6f618e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2016-07-03 John Baldwin + + * common/signals.c (gdb_signal_from_host): Handle SIGLIBRT. + (do_gdb_signal_to_host): Likewise. + * infrun.c (_initialize_infrun): Pass GDB_SIGNAL_LIBRT through to + programs. + * proc-events.c (signal_table): Add entry for SIGLIBRT. + 2016-07-01 John Baldwin * fbsd-nat.c (struct fbsd_fork_child_info): Rename to ... diff --git a/gdb/common/signals.c b/gdb/common/signals.c index 45c0c73..f84935d 100644 --- a/gdb/common/signals.c +++ b/gdb/common/signals.c @@ -331,6 +331,10 @@ gdb_signal_from_host (int hostsig) if (hostsig == SIGINFO) return GDB_SIGNAL_INFO; #endif +#if defined (SIGLIBRT) + if (hostsig == SIGLIBRT) + return GDB_SIGNAL_LIBRT; +#endif #if defined (REALTIME_LO) if (hostsig >= REALTIME_LO && hostsig < REALTIME_HI) @@ -584,6 +588,10 @@ do_gdb_signal_to_host (enum gdb_signal oursig, case GDB_SIGNAL_INFO: return SIGINFO; #endif +#if defined (SIGLIBRT) + case GDB_SIGNAL_LIBRT: + return SIGLIBRT; +#endif default: #if defined (REALTIME_LO) diff --git a/gdb/infrun.c b/gdb/infrun.c index 70a0790..257ac8a 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -9409,6 +9409,8 @@ leave it stopped or free to run as needed."), signal_print[GDB_SIGNAL_WAITING] = 0; signal_stop[GDB_SIGNAL_CANCEL] = 0; signal_print[GDB_SIGNAL_CANCEL] = 0; + signal_stop[GDB_SIGNAL_LIBRT] = 0; + signal_print[GDB_SIGNAL_LIBRT] = 0; /* Update cached state. */ signal_cache_update (-1); diff --git a/gdb/proc-events.c b/gdb/proc-events.c index b291d31..daa6f58 100644 --- a/gdb/proc-events.c +++ b/gdb/proc-events.c @@ -1536,6 +1536,9 @@ static struct trans signal_table[] = #ifdef SIGAIO { SIGAIO, "SIGAIO", "Asynchronous I/O signal" }, #endif +#ifdef SIGLIBRT + { SIGLIBRT, "SIGLIBRT", "Used by librt" }, +#endif /* FIXME: add real-time signals. */ }; diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog index f05ba4b..1ebb660 100644 --- a/include/gdb/ChangeLog +++ b/include/gdb/ChangeLog @@ -1,3 +1,7 @@ +2016-07-03 John Baldwin + + * signals.def: Add GDB_SIGNAL_LIBRT. + 2016-01-06 Mike Frysinger * remote-sim.h (sim_open): Mark argv const. diff --git a/include/gdb/signals.def b/include/gdb/signals.def index 61cc88c..2b30e71 100644 --- a/include/gdb/signals.def +++ b/include/gdb/signals.def @@ -194,7 +194,9 @@ SET (GDB_EXC_EMULATION, 148, "EXC_EMULATION", "Emulation instruction") SET (GDB_EXC_SOFTWARE, 149, "EXC_SOFTWARE", "Software generated exception") SET (GDB_EXC_BREAKPOINT, 150, "EXC_BREAKPOINT", "Breakpoint") +SET (GDB_SIGNAL_LIBRT, 151, "SIGLIBRT", "librt internal signal") + /* If you are adding a new signal, add it just above this comment. */ /* Last and unused enum value, for sizing arrays, etc. */ -SET (GDB_SIGNAL_LAST, 151, NULL, "GDB_SIGNAL_LAST") +SET (GDB_SIGNAL_LAST, 152, NULL, "GDB_SIGNAL_LAST")