This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] record: ask the target beneath to report all signals.
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 19 Jul 2012 18:58:17 +0100
- Subject: [PATCH] record: ask the target beneath to report all signals.
The previous patch to sigall-precsave.exp exposed another problem:
$ make check RUNTESTFLAGS="sigall-precsave.exp"
Running ../../../src/gdb/testsuite/gdb.reverse/sigall-precsave.exp ...
FAIL: gdb.reverse/sigall-precsave.exp: get signal TERM
FAIL: gdb.reverse/sigall-precsave.exp: send signal TERM
=== gdb Summary ===
# of expected passes 777
# of unexpected failures 2
# of expected failures 76
Also note the XFAILs count. (I haven't checked if the xfails still
make sense for this test, but they sort of hide the brokenness of the
test run.)
To record the execution log of the inferior, whenever the target is
continued, the record target turns that continue into a series of
single-steps. The record target wants to log all signals the inferior
sees. Using the record target with a software single-step arch (or my
x86 sss patches) reveals one problem. linux-nat.c has this short
circuit:
/* Don't report signals that GDB isn't interested in, such as
signals that are neither printed nor stopped upon. Stopping all
threads can be a bit time-consuming so if we want decent
performance with heavily multi-threaded programs, especially when
they're using a high frequency timer, we'd better avoid it if we
can. */
if (WIFSTOPPED (status))
{
enum gdb_signal signo = gdb_signal_from_host (WSTOPSIG (status));
/* When using hardware single-step, we need to report every signal.
Otherwise, signals in pass_mask may be short-circuited. */
if (!lp->step
&& WSTOPSIG (status) && sigismember (&pass_mask, WSTOPSIG (status)))
{
And with software single-step, since the target is really continued,
the short circuit always triggers, causing the record target not to
record signals that are in (pass,nostop,noprint) state.
This patch fixes it, by making the record target instruct the target
beneath to always report all signals.
Tested on x86_64 Fedora 17 {hardware,software} single-step. Fixes
sigall-precsave.exp on sss.
Applied.
2012-07-19 Pedro Alves <palves@redhat.com>
* record.c (record_resume): Ask the target beneath to report all
signals.
---
gdb/record.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gdb/record.c b/gdb/record.c
index ec42aac..e1a6121 100644
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -1104,6 +1104,9 @@ record_resume (struct target_ops *ops, ptid_t ptid, int step,
}
}
+ /* Make sure the target beneath reports all signals. */
+ target_pass_signals (0, NULL);
+
record_beneath_to_resume (record_beneath_to_resume_ops,
ptid, step, signal);
}