gdb/testsuite/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 7 Aug 2012 13:13:49 +0000 (13:13 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 7 Aug 2012 13:13:49 +0000 (13:13 +0000)
Do not false FAIL with old GCCs.
* gdb.base/watchpoint.exp (self-delete local watch) <$no_hw>: XFAIL for
GCC < 4.5 in $no_hw mode.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/watchpoint.exp

index 1446fcfb497ada703ce0c09a1c921114016e6b71..d0b0f35c689d4d650462d1fda8619bd19fedd2fd 100644 (file)
@@ -1,3 +1,9 @@
+2012-08-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Do not false FAIL with old GCCs.
+       * gdb.base/watchpoint.exp (self-delete local watch) <$no_hw>: XFAIL for
+       GCC < 4.5 in $no_hw mode.
+
 2012-08-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * gdb.base/default.exp (cd): Accept new directory with no arguments.
index b7ae2e1fe384efedbc2790fff671afc20f16db8a..09f23753af205ba4ee18e532d809fa2ea3e75ec8 100644 (file)
@@ -459,7 +459,27 @@ proc test_complex_watchpoint {} {
         #
         gdb_test "watch local_a" ".*\[Ww\]atchpoint \[0-9\]*: local_a" "set local watch"
         gdb_test "cont" "\[Ww\]atchpoint.*local_a.*" "trigger local watch"
-        gdb_test "cont" "Continuing.*\[Ww\]atchpoint .* deleted because the program has left the block in.*which its expression is valid.*" "self-delete local watch"
+
+       set test "self-delete local watch"
+        gdb_test_multiple "cont" $test {
+           -re "Continuing.*\[Ww\]atchpoint .* deleted because the program has left the block in.*which its expression is valid.*\r\n$gdb_prompt $" {
+               pass $test
+           }
+           -re "can't compute CFA for this frame.*\r\n$gdb_prompt $" {
+               global compiler_info no_hw
+
+               # GCC < 4.5.0 does not get LOCATIONS_VALID set by dwarf2read.c.
+               # Therefore epilogue unwinder gets applied which is
+               # incompatible with dwarf2_frame_cfa.
+               verbose -log "compiler_info: $compiler_info"
+               if {$no_hw && ([test_compiler_info {gcc-[0-3]-*}]
+                              || [test_compiler_info {gcc-4-[0-4]-*}])} {
+                   xfail "$test (old GCC has broken watchpoints in epilogues)"
+                   return
+               }
+               fail $test
+           }
+       }
 
        gdb_continue_to_breakpoint "func2 breakpoint here"
         # We should be in "func2" again now.  Test a watch of an