* lib/gdb.exp (skip_hw_breakpoint_tests): New procedure.
authorUlrich Weigand <uweigand@de.ibm.com>
Mon, 21 Feb 2011 14:57:38 +0000 (14:57 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Mon, 21 Feb 2011 14:57:38 +0000 (14:57 +0000)
(skip_hw_watchpoint_tests): Likewise.
(skip_hw_watchpoint_multi_tests): Likewise.
(skip_hw_watchpoint_access_tests): Likewise.

* gdb.base/hbreak.exp: Use appropriate skip_hw_..._tests checks.
* gdb.base/pr11022.exp: Likewise.
* gdb.base/watch-read.exp: Likewise.
* gdb.base/watch_thread_num.exp: Likewise.
* gdb.base/watchpoint-hw-hit-once.exp: Likewise.
* gdb.base/watchpoint-hw.exp: Likewise.
* gdb.base/watchpoint.exp: Likewise.
* gdb.threads/local-watch-wrong-thread.exp: Likewise.
* gdb.threads/watchthreads-reorder.exp: Likewise.
* gdb.threads/watchthreads.exp: Likewise.
* gdb.threads/watchthreads2.exp: Likewise.

13 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/hbreak.exp
gdb/testsuite/gdb.base/pr11022.exp
gdb/testsuite/gdb.base/watch-read.exp
gdb/testsuite/gdb.base/watch_thread_num.exp
gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp
gdb/testsuite/gdb.base/watchpoint-hw.exp
gdb/testsuite/gdb.base/watchpoint.exp
gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp
gdb/testsuite/gdb.threads/watchthreads-reorder.exp
gdb/testsuite/gdb.threads/watchthreads.exp
gdb/testsuite/gdb.threads/watchthreads2.exp
gdb/testsuite/lib/gdb.exp

index c40ce299e07fba9bc56311635c0e8ee10ee15df9..e86d6fa69c7602c5f9fd5b4ec6b9fdddd63a47b6 100644 (file)
@@ -1,3 +1,22 @@
+2011-02-21  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * lib/gdb.exp (skip_hw_breakpoint_tests): New procedure.
+       (skip_hw_watchpoint_tests): Likewise.
+       (skip_hw_watchpoint_multi_tests): Likewise.
+       (skip_hw_watchpoint_access_tests): Likewise.
+
+       * gdb.base/hbreak.exp: Use appropriate skip_hw_..._tests checks.
+       * gdb.base/pr11022.exp: Likewise.
+       * gdb.base/watch-read.exp: Likewise.
+       * gdb.base/watch_thread_num.exp: Likewise.
+       * gdb.base/watchpoint-hw-hit-once.exp: Likewise.
+       * gdb.base/watchpoint-hw.exp: Likewise.
+       * gdb.base/watchpoint.exp: Likewise.
+       * gdb.threads/local-watch-wrong-thread.exp: Likewise.
+       * gdb.threads/watchthreads-reorder.exp: Likewise.
+       * gdb.threads/watchthreads.exp: Likewise.
+       * gdb.threads/watchthreads2.exp: Likewise.
+
 2011-02-21  Joel Brobecker  <brobecker@adacore.com>
 
        * gdb.ada/packed_array.exp: Add xfail for "print u_var" if
index 7f797e3e9300d6b8d43c2b4838770ed906460be3..7612bcceb4b2a894cf55e04df9b2497989671563 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Arch not supporting hw watchpoints does not imply no_hardware_watchpoints set.
-if {(![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]
-     && ![istarget "ia64-*-*"])
-    || [target_info exists gdb,no_hardware_watchpoints]} then {
-    verbose "Skipping hbreak test."
-    return
+if {[skip_hw_breakpoint_tests]} {
+    return 0
 }
 
 set test hbreak
index 7115f22ae746955fafe97dfc248868598e5271c5..ec7bc33b887bc7ec81b19066ba23b18ecf56dc2d 100644 (file)
@@ -17,10 +17,8 @@ if $tracelevel then {
     strace $tracelevel
 }
 
-if [target_info exists gdb,no_hardware_watchpoints] {
-    # This test requires HW watchpoints
-    untested pr11022.exp
-    return -1
+if {[skip_hw_watchpoint_tests]} {
+    return 0
 }
 
 set testfile "pr11022"
index bf62987b6749c7480c41a5e54ab9afba73080d85..052de8477ffcf87ea932a05ed905def83e1b71a7 100644 (file)
@@ -27,9 +27,8 @@
 set testfile "watch-read"
 set srcfile ${testfile}.c
 
-if { [target_info exists gdb,no_hardware_watchpoints] } {
-    untested ${testfile}.exp
-    return -1
+if {[skip_hw_watchpoint_access_tests]} {
+    return 0
 }
 
 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
index e9807465bc5283f7d6fbe31eec504ee0591e5bfe..3a78edb9c3f120f7230b5be7b18accfa3c09c4ab 100644 (file)
@@ -25,8 +25,8 @@ if $tracelevel then {
 
 # This test verifies that a watchpoint is detected in the proper thread
 # so the test is only meaningful on a system with hardware watchpoints.
-if [target_info exists gdb,no_hardware_watchpoints] {
-    return 0;
+if {[skip_hw_watchpoint_tests]} {
+    return 0
 }
 
 set testfile watch_thread_num
index e560606fc6535d998a8b40c7a8445d851aef46e5..171b89b506e1ea8af35433ece69f2aafeebfc452 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Arch not supporting hw watchpoints does not imply no_hardware_watchpoints set.
-if {(![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]
-     && ![istarget "ia64-*-*"])
-    || [target_info exists gdb,no_hardware_watchpoints]} then {
-    verbose "Skipping watchpoint-hw-hit-once test."
-    return
+if {[skip_hw_watchpoint_access_tests]} {
+    return 0
 }
 
 set test watchpoint-hw-hit-once
index 3925929649ae53edc3c0d2c0709a31cc1c6877ee..3706699037ba81efee04f52a335d48bbbf326f69 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Arch not supporting hw watchpoints does not imply no_hardware_watchpoints set.
-if {(![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]
-     && ![istarget "ia64-*-*"] && ![istarget "s390*-*-*"])
-    || [target_info exists gdb,no_hardware_watchpoints]} then {
-    verbose "Skipping watchpoint-hw test."
-    return
+
+if {[skip_hw_watchpoint_tests]} {
+    return 0
 }
 
 set testfile watchpoint-hw
index 02df9a1c9cd6738f5bbcd3126019492ea1cb4733..7450602075d69e6404b33207713a720b98b303fe 100644 (file)
@@ -688,10 +688,10 @@ proc test_inaccessible_watchpoint {} {
            "$watchpoint_msg \[0-9\]+: \-location: \\*global_ptr"
        delete_breakpoints
 
-       # This step requires two HW watchpoints.  Since PPC Server only has
-       # a single one, it will use a SW watchpoint in this case.
-       if [istarget powerpc64-*] {
-           set watchpoint_msg "Watchpoint"
+       # This step requires two HW watchpoints.  Since some platforms only
+       # have a single one, accept either SW or HW watchpoint in this case.
+       if {[skip_hw_watchpoint_multi_tests]} {
+           set watchpoint_msg "(Watchpoint|Hardware watchpoint)"
        }
 
        gdb_test "watch *global_ptr" "$watchpoint_msg \[0-9\]+: \\\*global_ptr"
index 0247fbdd00f10c70fb270f97e1b9d62e42073b36..74f6268446681c9f8a21131ff5ae5526071230a9 100644 (file)
@@ -19,8 +19,8 @@
 # thread other than the thread the local watchpoint was set in stops
 # for a breakpoint.
 
-if [target_info exists gdb,no_hardware_watchpoints] {
-    return 0;
+if {[skip_hw_watchpoint_multi_tests]} {
+    return 0
 }
 
 set testfile "local-watch-wrong-thread"
index 7a232e0f45ebcda6726a690478a693c22a71fa5c..38e8b74e2a522298c9c93144526b51901216eaf8 100644 (file)
@@ -25,9 +25,8 @@
 # could be assigned during continuation of a thread with pending SIGTRAP to the
 # different/new watchpoint, just based on the watchpoint/debug register number.
 
-if {(![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]
-     && ![istarget "ia64-*-*"])
-    || [target_info exists gdb,no_hardware_watchpoints]
+if {[skip_hw_watchpoint_access_tests]
+    || [skip_hw_watchpoint_multi_tests]
     || ![istarget *-*-linux*]} {
     return 0
 }
index c852e5e25fd0e9530d433961f1e7c34051ae937e..a46cd6058a9d539a02a443e8b8c5fd8cbc92c260 100644 (file)
@@ -24,8 +24,8 @@ if $tracelevel {
 
 # This test verifies that a watchpoint is detected in the proper thread
 # so the test is only meaningful on a system with hardware watchpoints.
-if [target_info exists gdb,no_hardware_watchpoints] {
-    return 0;
+if {[skip_hw_watchpoint_multi_tests]} {
+    return 0
 }
 
 proc target_no_stopped_data { } {
index b3c774d82807fe3abe2578d44ab94d204b04ccc8..76ab1d497cd3dd3ce81a76e1d53f5be5890524ea 100644 (file)
@@ -28,8 +28,8 @@ if $tracelevel {
 
 # This test verifies that a watchpoint is detected in the proper thread
 # so the test is only meaningful on a system with hardware watchpoints.
-if [target_info exists gdb,no_hardware_watchpoints] {
-    return 0;
+if {[skip_hw_watchpoint_tests]} {
+    return 0
 }
 
 set testfile "watchthreads2"
index d523d8e36265564ffe9ace59ed52166313d4830c..3ba5488a09a02739144697aaf8dbdc085ebeee3a 100644 (file)
@@ -1783,6 +1783,76 @@ proc skip_inline_var_tests {} {
     return 0
 }
 
+# Return a 1 if we should skip tests that require hardware breakpoints
+
+proc skip_hw_breakpoint_tests {} {
+    # Skip tests if requested by the board (note that no_hardware_watchpoints
+    # disables both watchpoints and breakpoints)
+    if { [target_info exists gdb,no_hardware_watchpoints]} {
+       return 1
+    }
+
+    # These targets support hardware breakpoints natively
+    if { [istarget "i?86-*-*"] 
+        || [istarget "x86_64-*-*"]
+        || [istarget "ia64-*-*"] } {
+       return 0
+    }
+
+    return 1
+}
+
+# Return a 1 if we should skip tests that require hardware watchpoints
+
+proc skip_hw_watchpoint_tests {} {
+    # Skip tests if requested by the board
+    if { [target_info exists gdb,no_hardware_watchpoints]} {
+       return 1
+    }
+
+    # These targets support hardware watchpoints natively
+    if { [istarget "i?86-*-*"] 
+        || [istarget "x86_64-*-*"]
+        || [istarget "ia64-*-*"] 
+        || [istarget "powerpc*-*-linux*"]
+        || [istarget "s390*-*-*"] } {
+       return 0
+    }
+
+    return 1
+}
+
+# Return a 1 if we should skip tests that require *multiple* hardware
+# watchpoints to be active at the same time
+
+proc skip_hw_watchpoint_multi_tests {} {
+    if { [skip_hw_watchpoint_tests] } {
+       return 1
+    }
+
+    # These targets support just a single hardware watchpoint
+    if { [istarget "powerpc*-*-linux*"] } {
+       return 1
+    }
+
+    return 0
+}
+
+# Return a 1 if we should skip tests that require read/access watchpoints
+
+proc skip_hw_watchpoint_access_tests {} {
+    if { [skip_hw_watchpoint_tests] } {
+       return 1
+    }
+
+    # These targets support just write watchpoints
+    if { [istarget "s390*-*-*"] } {
+       return 1
+    }
+
+    return 0
+}
+
 set compiler_info              "unknown"
 set gcc_compiled               0
 set hp_cc_compiler             0