-# 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
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"
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 == "" } {