+2017-10-13 Pedro Alves <palves@redhat.com>
+
+ * lib/selftest-support.exp (selftest_setup): Extend comments, and
+ also skip on stub-like targets.
+
2017-10-13 Pedro Alves <palves@redhat.com>
PR gdb/22293
proc do_self_tests {function body} {
global GDB tool
- # Are we on a target board.
- if { [is_remote target] || ![isnative] } then {
+ # Are we testing with a remote board? In that case, the target
+ # won't have access to the GDB's auxilliary data files
+ # (data-directory, etc.). It's simpler to just skip.
+ if [is_remote target] {
+ return
+ }
+
+ # ... or seemingly testing with a cross debugger? Likely GDB
+ # wouldn't be able to debug itself then...
+ if ![isnative] {
+ return
+ }
+
+ # ... or with a stub-like server? I.e., gdbserver + "target
+ # remote"? In that case we won't be able to pass command line
+ # arguments to GDB, and selftest_setup wants to do exactly that.
+ if [target_info exists use_gdb_stub] {
return
}