]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.base/corefile.exp
Update copyright year range in all GDB files
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / corefile.exp
index b5f8ac42f79d6f54ff1d7f8081cac4504b7aea28..63a7fa8e5b427e3653db8cc5bb92e72f1a266ce8 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1992-2016 Free Software Foundation, Inc.
+# Copyright 1992-2018 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -188,6 +188,15 @@ gdb_test "core" "No core file now."
 proc corefile_test_run {} {
     global corefile gdb_prompt
 
+    # This test is trying to check whether the "run" command finds the
+    # default run target when already debugging a core, so it would
+    # fail on boards that set auto-connect-native-target off.  Since
+    # there's no real point in running the test but with the native
+    # target, it's easier to just skip elsewhere.
+    if {[target_info gdb_protocol] != ""} {
+       return
+    }
+
     gdb_test "core-file $corefile" "Core was generated by .*" "run: load core again"
     gdb_test "info files" "\r\nLocal core dump file:\r\n.*" "run: sanity check we see the core file"
 
@@ -244,7 +253,16 @@ gdb_exit
 proc corefile_test_attach {} {
     global binfile corefile gdb_prompt
 
-    if ![is_remote target] {
+    # This test is checking whether the "attach" command finds the
+    # default run target when already debugging a core, so it would
+    # fail on boards that set auto-connect-native-target off.  Since
+    # there's no real point in running the test but with the native
+    # target, it's easier to just skip elsewhere.
+    if {[target_info gdb_protocol] != ""} {
+       return
+    }
+
+    if [can_spawn_for_attach] {
        set test "attach: spawn sleep"
        set res [remote_spawn host "$binfile sleep"]
        if { $res < 0 || $res == "" } {