Fix no-attach-trace.exp with "target remote" / gdbserver
$ make check RUNTESTFLAGS="--target_board=native-gdbserver no-attach-trace.exp"
...
(gdb) trace main
Tracepoint 1 at 0x400594: file /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.trace/no-attach-trace.c, line 25.
(gdb) PASS: gdb.trace/no-attach-trace.exp: set tracepoint on main
tstart
You can't do that when your target is `exec'
(gdb) FAIL: gdb.trace/no-attach-trace.exp: tstart
Even though this target supports tracing, the test restarts GDB and
doesn't do gdb_run_cmd so does not reconnect to the remote target. So
at that point, GDB only has the "exec" target, which obviously doesn't
do tracing.
The test is about doing "tstart" before running a program, so the fix
is to do gdb_target_supports_trace with whatever target GDB ends up
connected after clean_restart.
Tested on x86_64 Fedora 20, native, native-gdbserver and
native-extended-gdbserver boards. The test passes with the latter,
and is skipped with the first two.
gdb/testsuite/ChangeLog:
2015-02-20 Pedro Alves <palves@redhat.com>
* gdb.trace/no-attach-trace.exp: Don't run to main. Do
clean_restart before gdb_target_supports_trace.