diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 117ab9bb53..3532ed3ed0 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2017-10-13 Pedro Alves + + * gdb.base/corefile.exp (corefile_test_run): Skip if gdb_protocol + is set. + (corefile_test_attach): Likewise. Check can_spawn_for_attach + instead of is_remote. + 2017-10-13 Pedro Alves * gdb.base/remote.exp: Check gdb_protocol instead of is_remote. diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp index 21b974fbbd..9be4aef7f4 100644 --- a/gdb/testsuite/gdb.base/corefile.exp +++ b/gdb/testsuite/gdb.base/corefile.exp @@ -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 == "" } {