fix python-selftest.exp failure with gdbserver
authorTom Tromey <tromey@redhat.com>
Tue, 18 Jun 2013 14:12:09 +0000 (14:12 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 18 Jun 2013 14:12:09 +0000 (14:12 +0000)
python-selftest.exp fails with an error when using the
native-gdbserver.exp board.

The bug is that the selftest code doesn't work in this situation.  It
never has.

This patch fixes the problem by pushing the needed check into
do_self_tests.  This helps prevent the problem in the future.

* lib/selftest-support.exp (do_self_tests): Reject remote or
non-native targets.
* gdb.gdb/complaints.exp: Remove check.
* gdb.gdb/observer.exp: Remove check.
* gdb.gdb/xfullpath.exp: Remove check.
* gdb.gdb/complaints.exp: Remove check.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.gdb/complaints.exp
gdb/testsuite/gdb.gdb/observer.exp
gdb/testsuite/gdb.gdb/xfullpath.exp
gdb/testsuite/lib/selftest-support.exp

index 06217f99b86cf8cea7fb7172c547fbe9551463df..7c659ca210e03ee8269a7a9064bc2e3ecf76e73f 100644 (file)
@@ -1,3 +1,12 @@
+2013-06-18  Tom Tromey  <tromey@redhat.com>
+
+       * lib/selftest-support.exp (do_self_tests): Reject remote or
+       non-native targets.
+       * gdb.gdb/complaints.exp: Remove check.
+       * gdb.gdb/observer.exp: Remove check.
+       * gdb.gdb/xfullpath.exp: Remove check.
+       * gdb.gdb/complaints.exp: Remove check.
+
 2013-06-07  Pedro Alves  <palves@redhat.com>
 
        * boards/native-extended-gdbserver.exp: Remove semicolon.
index 932dfd583671fe84af7f1cf2a7209907cac61c53..e5f6e4ae19e66a2f91c16b1a3420f9107fbee21b 100644 (file)
 
 load_lib selftest-support.exp
 
-# are we on a target board
-if { [is_remote target] || ![isnative] } then {
-    return
-}
-
 if [target_info exists gdb,noinferiorio] {
     verbose "Skipping because of no inferiorio capabilities."
     return
index 32030d88da302480b01c806c047188d481669f4a..b70c2b117063c5400cc06b62970097bd14a58a76 100644 (file)
 
 load_lib selftest-support.exp
 
-# are we on a target board
-if { [is_remote target] || ![isnative] } then {
-    return
-}
-
 proc attach_first_observer { message } {
     gdb_test_no_output "set \$first_obs = observer_attach_test_notification (&observer_test_first_notification_function)" \
        "$message; attach first observer"
index 5bc01c6f822309540883b1fa64e240b99d5bd57e..d758a18c8800ca22c3651594c25ed884ea8553ae 100644 (file)
 
 load_lib selftest-support.exp
 
-# are we on a target board
-if { [is_remote target] || ![isnative] } then {
-    return
-}
-
 proc test_with_self {} {
     # A file which contains a directory prefix
     gdb_test "print gdb_realpath (\"./xfullpath.exp\")" \
index c3758499dc8857dac1cbabc1412e82eec381df7c..fc4bccce69cbd709bce7a31dc3fd46d35684e91a 100644 (file)
@@ -119,6 +119,11 @@ proc selftest_setup { executable function } {
 proc do_self_tests {function body} {
     global GDB tool
 
+    # Are we on a target board.
+    if { [is_remote target] || ![isnative] } then {
+       return
+    }
+
     # Run the test with self.  Copy the file executable file in case
     # this OS doesn't like to edit its own text space.