Testsuite: fully migrate to use_gdb_stub convenience func
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Fri, 23 Mar 2018 09:38:23 +0000 (10:38 +0100)
committerAndreas Arnez <arnez@linux.vnet.ibm.com>
Fri, 23 Mar 2018 09:38:23 +0000 (10:38 +0100)
In the GDB test suite, there are still multiple invocations of
"target_info exists use_gdb_stub".  However, the recommended way of
checking for use_gdb_stub is to call the convenience function of the same
name.

Replace these occurrences and just call "use_gdb_stub" instead.

gdb/testsuite/ChangeLog:

* gdb.ada/exec_changed.exp: Replace "target_info exists
use_gdb_stub" by "use_gdb_stub".
* gdb.ada/start.exp: Likewise.
* gdb.base/async-shell.exp: Likewise.
* gdb.base/attach-pie-misread.exp: Likewise.
* gdb.base/attach-wait-input.exp: Likewise.
* gdb.base/break-entry.exp: Likewise.
* gdb.base/break-interp.exp: Likewise.
* gdb.base/dprintf-detach.exp: Likewise.
* gdb.base/nostdlib.exp: Likewise.
* gdb.base/solib-nodir.exp: Likewise.
* gdb.base/statistics.exp: Likewise.
* gdb.base/testenv.exp: Likewise.
* gdb.mi/mi-exec-run.exp: Likewise.
* gdb.mi/mi-start.exp: Likewise.
* gdb.multi/dummy-frame-restore.exp: Likewise.
* gdb.multi/multi-arch-exec.exp: Likewise.
* gdb.multi/multi-arch.exp: Likewise.
* gdb.multi/tids.exp: Likewise.
* gdb.multi/watchpoint-multi.exp: Likewise.
* gdb.python/py-events.exp: Likewise.
* gdb.threads/attach-into-signal.exp: Likewise.
* gdb.threads/attach-stopped.exp: Likewise.
* gdb.threads/threadapply.exp: Likewise.
* lib/selftest-support.exp: Likewise.

25 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/exec_changed.exp
gdb/testsuite/gdb.ada/start.exp
gdb/testsuite/gdb.base/async-shell.exp
gdb/testsuite/gdb.base/attach-pie-misread.exp
gdb/testsuite/gdb.base/attach-wait-input.exp
gdb/testsuite/gdb.base/break-entry.exp
gdb/testsuite/gdb.base/break-interp.exp
gdb/testsuite/gdb.base/dprintf-detach.exp
gdb/testsuite/gdb.base/nostdlib.exp
gdb/testsuite/gdb.base/solib-nodir.exp
gdb/testsuite/gdb.base/statistics.exp
gdb/testsuite/gdb.base/testenv.exp
gdb/testsuite/gdb.mi/mi-exec-run.exp
gdb/testsuite/gdb.mi/mi-start.exp
gdb/testsuite/gdb.multi/dummy-frame-restore.exp
gdb/testsuite/gdb.multi/multi-arch-exec.exp
gdb/testsuite/gdb.multi/multi-arch.exp
gdb/testsuite/gdb.multi/tids.exp
gdb/testsuite/gdb.multi/watchpoint-multi.exp
gdb/testsuite/gdb.python/py-events.exp
gdb/testsuite/gdb.threads/attach-into-signal.exp
gdb/testsuite/gdb.threads/attach-stopped.exp
gdb/testsuite/gdb.threads/threadapply.exp
gdb/testsuite/lib/selftest-support.exp

index bbd09912af5d855e7c0aba9f27c797bf277ab375..065b1c3f5d536aa37ef46b7fcb1bfe747065baed 100644 (file)
@@ -1,3 +1,31 @@
+2018-03-23  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
+       * gdb.ada/exec_changed.exp: Replace "target_info exists
+       use_gdb_stub" by "use_gdb_stub".
+       * gdb.ada/start.exp: Likewise.
+       * gdb.base/async-shell.exp: Likewise.
+       * gdb.base/attach-pie-misread.exp: Likewise.
+       * gdb.base/attach-wait-input.exp: Likewise.
+       * gdb.base/break-entry.exp: Likewise.
+       * gdb.base/break-interp.exp: Likewise.
+       * gdb.base/dprintf-detach.exp: Likewise.
+       * gdb.base/nostdlib.exp: Likewise.
+       * gdb.base/solib-nodir.exp: Likewise.
+       * gdb.base/statistics.exp: Likewise.
+       * gdb.base/testenv.exp: Likewise.
+       * gdb.mi/mi-exec-run.exp: Likewise.
+       * gdb.mi/mi-start.exp: Likewise.
+       * gdb.multi/dummy-frame-restore.exp: Likewise.
+       * gdb.multi/multi-arch-exec.exp: Likewise.
+       * gdb.multi/multi-arch.exp: Likewise.
+       * gdb.multi/tids.exp: Likewise.
+       * gdb.multi/watchpoint-multi.exp: Likewise.
+       * gdb.python/py-events.exp: Likewise.
+       * gdb.threads/attach-into-signal.exp: Likewise.
+       * gdb.threads/attach-stopped.exp: Likewise.
+       * gdb.threads/threadapply.exp: Likewise.
+       * lib/selftest-support.exp: Likewise.
+
 2018-03-22  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
        * gdb.base/info-proc.exp: Add test for "info proc cmdline".
index 8070eecbb348269c212a565de519170216258b78..943a75178bfd0318b51542ca161a8a1f0828dbd9 100644 (file)
@@ -19,7 +19,7 @@ if { [skip_ada_tests] } { return -1 }
 
 # This testcase verifies the behavior of the `start' command, which
 # does not work when we use the gdb stub...
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     untested "skipping tests due to use_gdb_stub"
     return
 }
index 711f3dfefdfb4c042fe333ec80f6f379851c4b2a..cbf615e956001f38bd1e78e9fbee922770758944 100644 (file)
@@ -19,7 +19,7 @@ if { [skip_ada_tests] } { return -1 }
 
 # This testcase verifies the behavior of the `start' command, which
 # does not work when we use the gdb stub...
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     untested "skipping test due to gdb stub"
     return
 }
index c7782f404a5969c003ee870700de5387ca0c1ee9..37046d6f48bd80908ae6a48d5769c0402bec82c9 100644 (file)
@@ -21,7 +21,7 @@ if { ![support_displaced_stepping] } {
 }
 
 # The testfile uses "run".  The real bug happened only for ![is_remote target].
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     return 0
 }
 
index aa7710a3971e0664bebf1bdbcd5ed1ddc8fccb60..b693d3a2ba46f418686363189dff779f395dcad5 100644 (file)
@@ -14,7 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works on GNU/Linux.
-if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
+if { ![isnative] || [is_remote host] || [use_gdb_stub]
      || ![istarget *-linux*] || [skip_shlib_tests]} {
     continue
 }
index 67abaa22e975be56eb57a72a97b4b5657d92c14a..776cac884cafb632f6107cdb24ed92ba3a79b9b6 100644 (file)
@@ -29,7 +29,7 @@
 # simpler to do, so we test with both editing on and off.
 
 # The test uses the "attach" command.
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     return
 }
 
index 8775b38a397ec7a2c25e7f80b9190ce21562d2f3..85de662a6d2e6f35c9f51a9b928e9434a41ea36b 100644 (file)
@@ -27,7 +27,7 @@
 
 standard_testfile start.c
 
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     untested "skipping tests due to use_gdb_stub"
     return
 }
index a065d9803d8ba4179b9226b4a3dc25f188bff228..72117cb4a6f0ece54b95fbe797d09ad1157940e4 100644 (file)
@@ -14,7 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works on GNU/Linux.
-if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
+if { ![isnative] || [is_remote host] || [use_gdb_stub]
      || ![istarget *-linux*] || [skip_shlib_tests]} {
     continue
 }
index ed92c4a01adf0e22e7207208cab1a37377cbaac7..4c3b33b777261ba8861f0a71c22a281aed3b451c 100644 (file)
@@ -21,7 +21,7 @@
 load_lib gdbserver-support.exp
 
 # The test relies on "detach/attach".
-if { [target_info exists use_gdb_stub] } then {
+if { [use_gdb_stub] } then {
     return 0
 }
 
index 54b6cb3ec6eb558d00bec66f968174e5188034b7..2ce21322de8cbfb67a5eea0978425eb64543fad9 100644 (file)
@@ -18,7 +18,7 @@ standard_testfile .c
 # If we're using a stub, breakpoints at the entry point will not trigger.
 # See also the comment in break-entry.exp.
 
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     untested "skipping tests due to use_gdb_stub"
     return
 }
index 42314c828083811799fcab7cda13901688de1d4e..911d614063fb17f9db56803a87e3144cc0ebd626 100644 (file)
@@ -25,7 +25,7 @@ if [is_remote target] {
 # We need to be able to influence the target's environment and working
 # directory.  Can't do that if when we connect the inferior is already
 # running.
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     return
 }
 
index eb99ff411a34697cc846331bab5e02f0d7c7d732..c093b03b1bba62be714095635c7ddae981699f95 100644 (file)
@@ -18,7 +18,7 @@ standard_testfile
 gdb_exit
 
 # Inlined default_gdb_start.
-set use_gdb_stub [target_info exists use_gdb_stub]
+set use_gdb_stub [use_gdb_stub]
 set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts] -statistics"]
 if { $res < 0 || $res == "" } {
     perror "Spawning $GDB failed."
index 4c123d9ce00dc3bbb6939c0db4ba2cc74f41f14f..4c4c6e63bed2ba3178c9928f739354fab1cf0cb1 100644 (file)
@@ -20,7 +20,7 @@
 
 # Can't pass environment variables to the inferior if when we connect,
 # the inferior is already running.
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     return
 }
 
index 7e1758f5255dc84424b901ac8a785a607626051f..ca3da5d3bfb8d699c881c88e5bdd365f64dff2f9 100644 (file)
@@ -28,7 +28,7 @@ set MIFLAGS "-i=mi"
 
 # The purpose of this testcase is to test the -exec-run command. If we
 # cannot use it, then there is no point in running this testcase.
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
      untested "cannot use -exec-run command"
      return -1
 }
index 64f7f47a3ce1f08683c8d6265f6000683c64874c..185318ae3b1b89294fac13aec0523f0225861cbe 100644 (file)
@@ -19,7 +19,7 @@ set MIFLAGS "-i=mi"
 # The purpose of this testcase is to test the --start option of
 # the -exec-run command. If we cannot use the -exec-run command,
 # then there is no point in running this testcase...
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
      untested "cannot use -exec-run command"
      return -1
 }
index 4372081ee7c6975a368abbb16c09e3d5e2720c5d..b5b012f4b1f053ae1619945c792291ea9028980f 100644 (file)
@@ -17,7 +17,7 @@ standard_testfile .c
 set executable ${testfile}
 
 # The plain remote target can't do multiple inferiors.
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     return
 }
 
index eaaa9ecd405dd1179b48b7eb16c1b90b0e3b5e2d..9ff439d2a349d644d9f7a1ff894e220a1a4f4804 100644 (file)
@@ -19,7 +19,7 @@
 set testfile "multi-arch-exec"
 
 # The plain remote target can't do multiple inferiors.
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     return
 }
 
index 61ab15b49ad7b0bb9c8790b65eee490dd4b0536c..3a90f028e1f9986aec5be3f3a45eec0c6769dd07 100644 (file)
@@ -19,7 +19,7 @@
 set testfile "multi-arch"
 
 # The plain remote target can't do multiple inferiors.
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     return
 }
 
index 334e08e7a7688e37fe052662e4ee14a695443112..67349b575956f9a9665f5c4a6cd56a14041d8c52 100644 (file)
@@ -22,7 +22,7 @@ standard_testfile
 # Multiple inferiors are needed, therefore both native and extended
 # gdbserver modes are supported.  Only non-extended gdbserver is not
 # supported.
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     untested "using gdb stub"
     return
 }
index 5234304ebebef0bdfa52a9d0ba7e1ad932494d7e..bba1b902eb143ccfb71ad5824d43a7719e13bea6 100644 (file)
@@ -18,7 +18,7 @@ set executable ${testfile}
 
 # Multiple inferiors are needed, therefore both native and extended gdbserver
 # modes are supported.  Only non-extended gdbserver is not supported.
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     untested "using gdb stub"
     return
 }
index 26cc802045f19e708c61def837f337ecbb07580f..5109e7ac75dd61dd8401bb3ac07e6ccd49d085fe 100644 (file)
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     return 0
 }
 
index 446f00c984a31a50922c36766c4b3d9f339c23be..4a0a670a289e45933cb95dcee8e1d25d34c36086 100644 (file)
@@ -17,7 +17,7 @@
 # This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
 
 # This test only works on Linux
-if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
+if { ![isnative] || [is_remote host] || [use_gdb_stub]
      || ![istarget *-linux*] } {
     continue
 }
index 6c8c8bf10e4d91bdd631461c62cc014067b86652..a3916c6354dbca8ed773f69d2a150bf48e188e08 100644 (file)
@@ -18,7 +18,7 @@
 # This file was updated by Jan Kratochvil <jan.kratochvil@redhat.com>.
 
 # This test only works on Linux
-if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
+if { ![isnative] || [is_remote host] || [use_gdb_stub]
      || ![istarget *-linux*] } {
     continue
 }
index fc8aac6e06d99ab582a196f35fe555b4c386faae..8979ee38d8c6a44b4865ee960ce153a0b50323c7 100644 (file)
@@ -105,7 +105,7 @@ proc kill_and_remove_inferior {thread_set} {
 
     # The test starts multiple inferiors, therefore non-extended
     # remote is not supported.
-    if [target_info exists use_gdb_stub] {
+    if [use_gdb_stub] {
        unsupported "using gdb stub"
        return
     }
index 89e2e3f4ef0ddd63c19b5844e6c4bdbb947760aa..f7169e0955e3fba002276a682abd716b363cf0b6 100644 (file)
@@ -140,7 +140,7 @@ proc do_self_tests {function body} {
     # ... or with a stub-like server?  I.e., gdbserver + "target
     # remote"?  In that case we won't be able to pass command line
     # arguments to GDB, and selftest_setup wants to do exactly that.
-    if [target_info exists use_gdb_stub] {
+    if [use_gdb_stub] {
        return
     }
 
This page took 0.040972 seconds and 4 git commands to generate.