aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi/mi-watch.exp
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2023-02-17 15:19:12 +0000
committerAndrew Burgess <aburgess@redhat.com>2023-02-28 10:56:28 +0000
commit292deeba7d6e0f1df99fff8c18000a1a3c481f3a (patch)
tree1faef9f4c1998fc631adb142b1f77b8561c3f72e /gdb/testsuite/gdb.mi/mi-watch.exp
parent1ccc4abbb3dda91c94c54d3aaaa417f0d7740a3f (diff)
downloadbinutils-292deeba7d6e0f1df99fff8c18000a1a3c481f3a.zip
binutils-292deeba7d6e0f1df99fff8c18000a1a3c481f3a.tar.gz
binutils-292deeba7d6e0f1df99fff8c18000a1a3c481f3a.tar.bz2
gdb/testsuite introduce foreach_mi_ui_mode helper proc
Introduce foreach_mi_ui_mode, a helper proc which can be used when tests are going to be repeated once with the MI in the main UI, and once with the MI on a separate UI. The proc is used like this: foreach_mi_ui_mode VAR { # BODY } The BODY will be run twice, once with VAR set to 'main' and once with VAR set to 'separate', inside BODY we can then change the behaviour based on the current UI mode. The point of this proc is that we sometimes shouldn't run the separate UI tests (when gdb_debug_enabled is true), and this proc hides all this logic. If the separate UI mode should not be used then BODY will be run just once with VAR set to 'main'. I've updated two tests that can make use of this helper proc. I'm going to add another similar test in a later commit. There should be no change to what is tested with this commit. Approved-By: Pedro Alves <pedro@palves.net>
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-watch.exp')
-rw-r--r--gdb/testsuite/gdb.mi/mi-watch.exp9
1 files changed, 1 insertions, 8 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp
index aaac761..12b9781 100644
--- a/gdb/testsuite/gdb.mi/mi-watch.exp
+++ b/gdb/testsuite/gdb.mi/mi-watch.exp
@@ -175,16 +175,9 @@ proc test_watchpoint_all {mi_mode type} {
test_watchpoint_triggering
}
-if [gdb_debug_enabled] {
- # gdb debug doesn't work for separate-mi-tty.
- set modes {"main"}
-} else {
- set modes {"main" "separate"}
-}
-
# Run the tests twice, once using software watchpoints, and another
# with hardware watchpoints.
-foreach_with_prefix mi-mode $modes {
+foreach_mi_ui_mode mi-mode {
foreach_with_prefix wp-type {"sw" "hw"} {
test_watchpoint_all ${mi-mode} ${wp-type}
}