This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] testsuite: stale-infcall.exp FAIL->XFAIL
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Doug Evans <dje at google dot com>
- Date: Thu, 28 Jun 2012 01:46:08 +0200
- Subject: [patch] testsuite: stale-infcall.exp FAIL->XFAIL
Hi Doug,
as you bugreported on IRC that stale-infcall.exp is FAILing for you. I have
checked it is FAILing for me on FSF GDB + RHEL-5 and RHEL-6. This is because
gdb.base/longjmp.exp also does not work there. Apparently when longjmp
support is not working for GDB it cannot be used to discard stale infcall
pads.
This means that with glibc not supporting longjmp tracking the ON_STACK change
has a real regression for stale-infcall.exp. OTOH there were various targets
with ON_STACK for many years in GDB without this longjmp tracking and nobody
complained. longjmp-ing out of an infcall is a real cornercase GDB can live
with on particular systems not supporting all the latest features.
So going to check in this patch for gdb-7.5.
No regressions on {x86_64,x86_64-m32,i686}-fedorarawhide-linux-gnu.
Thanks for the bugreport,
Jan
gdb/testsuite/
2012-06-28 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/stale-infcall.c (infcall): New label test-next.
(main): New labels test-pass and test-fail.
* gdb.base/stale-infcall.exp: Continue to test-next. Put breakpoint
$test_fail_bpnum to test-fail.
(test system longjmp tracking support): New test.
Delete $test_fail_bpnum.
* lib/gdb.exp (gdb_continue_to_breakpoint): Accept also Temporary
breakpoint.
diff --git a/gdb/testsuite/gdb.base/stale-infcall.c b/gdb/testsuite/gdb.base/stale-infcall.c
index 1f5169a..e4f97fa 100644
--- a/gdb/testsuite/gdb.base/stale-infcall.c
+++ b/gdb/testsuite/gdb.base/stale-infcall.c
@@ -26,7 +26,7 @@ static jmp_buf jmp;
void
infcall (void)
{
- longjmp (jmp, 1);
+ longjmp (jmp, 1); /* test-next */
}
static void
@@ -54,7 +54,10 @@ run2 (void)
int
main ()
{
- if (setjmp (jmp) == 0)
+ if (setjmp (jmp) == 0) /* test-pass */
+ infcall ();
+
+ if (setjmp (jmp) == 0) /* test-fail */
run1 ();
else
run2 ();
diff --git a/gdb/testsuite/gdb.base/stale-infcall.exp b/gdb/testsuite/gdb.base/stale-infcall.exp
index bb22339..ce1ca1f 100644
--- a/gdb/testsuite/gdb.base/stale-infcall.exp
+++ b/gdb/testsuite/gdb.base/stale-infcall.exp
@@ -23,6 +23,24 @@ if ![runto_main] {
return -1
}
+gdb_breakpoint [gdb_get_line_number "test-next"] temporary
+gdb_continue_to_breakpoint "test-next" ".* test-next .*"
+gdb_breakpoint [gdb_get_line_number "test-fail"]
+gdb_test_no_output {set $test_fail_bpnum=$bpnum}
+
+set test "test system longjmp tracking support"
+gdb_test_multiple "next" $test {
+ -re " test-pass .*\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re " test-fail .*\r\n$gdb_prompt $" {
+ xfail $test
+ untested "System lacks support for tracking longjmps"
+ return -1
+ }
+}
+gdb_test_no_output {delete $test_fail_bpnum}
+
gdb_breakpoint [gdb_get_line_number "break-run1"]
gdb_breakpoint [gdb_get_line_number "break-run2"]
gdb_breakpoint [gdb_get_line_number "break-exit"]
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 7cb619a..289d4d8 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -469,7 +469,7 @@ proc gdb_continue_to_breakpoint {name {location_pattern .*}} {
send_gdb "continue\n"
gdb_expect {
- -re "Breakpoint .* (at|in) $location_pattern\r\n$gdb_prompt $" {
+ -re "(?:Breakpoint|Temporary breakpoint) .* (at|in) $location_pattern\r\n$gdb_prompt $" {
pass $full_name
}
-re ".*$gdb_prompt $" {