This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Don't rely on inferior I/O in gdb.base/siginfo-addr.exp
- From: Pedro Alves <palves at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 29 Jul 2015 11:31:06 -0000
- Subject: [binutils-gdb] Don't rely on inferior I/O in gdb.base/siginfo-addr.exp
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=655669183104eb8eab559b5faf2b5a676ab6cd3f
commit 655669183104eb8eab559b5faf2b5a676ab6cd3f
Author: Pedro Alves <palves@redhat.com>
Date: Wed Jul 29 11:09:36 2015 +0100
Don't rely on inferior I/O in gdb.base/siginfo-addr.exp
No point in relying on stdio in this test. Simply run to a breakpoint
instead.
gdb/testsuite/ChangeLog:
2015-07-29 Pedro Alves <palves@redhat.com>
* gdb.base/siginfo-addr.c (pass): New function.
(handler): Call it iff si_addr is correct.
* gdb.base/siginfo-addr.exp: Remove gdb_skip_stdio_test check.
Set a breakpoint at "pass" and continue to it.
Diff:
---
gdb/testsuite/ChangeLog | 7 +++++++
gdb/testsuite/gdb.base/siginfo-addr.c | 9 ++++++---
gdb/testsuite/gdb.base/siginfo-addr.exp | 17 +++--------------
3 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 34f6d8b..9f36af6 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2015-07-29 Pedro Alves <palves@redhat.com>
+
+ * gdb.base/siginfo-addr.c (pass): New function.
+ (handler): Call it iff si_addr is correct.
+ * gdb.base/siginfo-addr.exp: Remove gdb_skip_stdio_test check.
+ Set a breakpoint at "pass" and continue to it.
+
2015-07-28 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.python/py-objfile.exp: Make some tests have unique names.
diff --git a/gdb/testsuite/gdb.base/siginfo-addr.c b/gdb/testsuite/gdb.base/siginfo-addr.c
index a074b4d..c6d8556 100644
--- a/gdb/testsuite/gdb.base/siginfo-addr.c
+++ b/gdb/testsuite/gdb.base/siginfo-addr.c
@@ -26,13 +26,16 @@
static void *p;
+void
+pass (void)
+{
+}
+
static void
handler (int sig, siginfo_t *info, void *context)
{
if (info->si_addr == p)
- printf ("Correct si_addr value.\n");
- else
- printf ("Got si_addr = %p, expected %p.\n", info->si_addr, p);
+ pass ();
_exit (0);
}
diff --git a/gdb/testsuite/gdb.base/siginfo-addr.exp b/gdb/testsuite/gdb.base/siginfo-addr.exp
index 5ac6105..e2f5914 100644
--- a/gdb/testsuite/gdb.base/siginfo-addr.exp
+++ b/gdb/testsuite/gdb.base/siginfo-addr.exp
@@ -26,11 +26,6 @@ if [target_info exists gdb,nosignals] {
continue
}
-if [gdb_skip_stdio_test "siginfo-addr.exp"] {
- continue
-}
-
-
standard_testfile
if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
untested "Couldn't compile ${srcfile}.c"
@@ -47,13 +42,7 @@ if { ![runto_main] } then {
# Run to the signal.
gdb_test "continue" ".*Program received signal SIGSEGV.*" "continue to signal"
+gdb_breakpoint "pass"
+
# Check for correct si_addr.
-set test "program exit"
-gdb_test_multiple "continue" "${test}" {
- -re "Correct si_addr" {
- pass "si_addr value"
- }
- -re "Got si_addr" {
- fail "si_addr value"
- }
-}
+gdb_test "continue" "Breakpoint .* pass .*" "correct si_addr"