gdb/testsuite/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 2 Jul 2012 12:06:56 +0000 (12:06 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 2 Jul 2012 12:06:56 +0000 (12:06 +0000)
* 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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/stale-infcall.c
gdb/testsuite/gdb.base/stale-infcall.exp
gdb/testsuite/lib/gdb.exp

index 2f4d131005a528284aa2632cdca4ef3b7583fee0..44673d476533ab13899689406f5fbf01ca2f3e9b 100644 (file)
@@ -1,3 +1,14 @@
+2012-07-02  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.
+
 2012-06-30  Doug Evans  <dje@google.com>
 
        * gdb.dwarf2/fission-reread.S: New file.
index 1f5169a7c8e2eaf018bc1df2b6954ae8441f50e4..e4f97fa3ab25943c727d31b2798b294cc20b2f4d 100644 (file)
@@ -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 ();
index bb22339b12743e58b797e30949f927a68fd40736..9d73ebdbd18c3931bb410ebc99b438539fb73a9a 100644 (file)
@@ -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"]
index 7cb619a85552ce8ec85ef8d855404108d91c4a60..289d4d82123551028a740e82faf8d4d470a20822 100644 (file)
@@ -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 $" {