Fix is_remote check in gdb.base/remote.exp
authorPedro Alves <palves@redhat.com>
Fri, 13 Oct 2017 09:48:42 +0000 (10:48 +0100)
committerPedro Alves <palves@redhat.com>
Fri, 13 Oct 2017 10:20:37 +0000 (11:20 +0100)
1. Otherwise, when the native-gdbserver board stops setting is_remote,
   this test would stop running there.

2. Makes the test run with --target_board=native-extended-gdbserver
   too.

gdb/testsuite/ChangeLog:
2017-10-13  Pedro Alves  <palves@redhat.com>

* gdb.base/remote.exp: Check gdb_protocol instead of is_remote.
(top level): Add comment.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/remote.exp

index 51d788b19fbe5ae3ec6d4cfffe16ca8f43f74e2d..117ab9bb53e6d6c780d97b5c2c2456e98024a5d3 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-13  Pedro Alves  <palves@redhat.com>
+
+       * gdb.base/remote.exp: Check gdb_protocol instead of is_remote.
+       (top level): Add comment.
+
 2017-10-13  Pedro Alves  <palves@redhat.com>
 
        * gdb.base/remote.exp (top level): Fix comment typo and add
index db6fc006091164cabeff6e262a72eb104c406760..2f3ede17fc66f590f40c1981fc8ff2d77f4d482b 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/>.
 
-
-
-# test only on a remote target board
-if {! [is_remote target]} {
+# Test only on boards that actually use the remote protocol.
+if {[target_info gdb_protocol] != "remote"
+    && [target_info gdb_protocol] != "extended-remote"} {
     return
 }
 
@@ -103,6 +102,10 @@ proc gdb_load_timed {executable class writesize} {
     pass $test
 }
 
+# These download tests won't actually download anything on !is_remote
+# target boards, but we run them anyway because it's simpler, and
+# harmless.
+
 # Typically about 400-1 bytes can be downloaded
 gdb_load_timed $binfile "limit" 398
 gdb_load_timed $binfile "limit" 400