f71c18e755
Some important tests, like gdb.base/interrupt.exp end up skipped against gdbserver, because they depend on inferior I/O, which gdbserver doesn't do. This patch adds a mechanism that makes it possible to make them work. It adds a new "inferior_spawn_id" global that is the spawn ID used for I/O interaction with the inferior. By default, for native targets, or remote targets that can do I/O through GDB (semi-hosting) this will be the same as the gdb/host spawn ID. Otherwise, the board may set this to some other spawn ID. When debugging with GDBserver, this will be set to GDBserver's spawn ID. Then tests can use send_inferior instead of send_gdb to send input to the inferior, and use expect's "-i" switch to select which spawn ID to use for matching input/output. That is, something like this will now work: send_inferior "echo me\n" gdb_test_multiple "continue" "test msg" { -i "$inferior_spawn_id" -re "echo me\r\necho\r\n" { ... } } Or even: gdb_test_multiple "continue" "test msg" { -i "$inferior_spawn_id" -re "hello world" { ... } -i "$gdb_spawn_id" -re "error.*$gdb_prompt $" { ... } } Of course, by default, gdb_test_multiple still matches with $gdb_spawn_id. gdb/testsuite/ChangeLog: 2015-04-07 Pedro Alves <palves@redhat.com> * lib/gdb.exp (inferior_spawn_id): New global. (gdb_test_multiple): Handle "-i". Reset the spawn id to GDB's spawn id after processing the user code. (default_gdb_start): Set inferior_spawn_id. (send_inferior): New procedure. * lib/gdbserver-support.exp (gdbserver_start): Set inferior_spawn_id. (close_gdbserver, gdb_exit): Unset inferior_spawn_id. |
||
---|---|---|
.. | ||
ada.exp | ||
append_gdb_boards_dir.exp | ||
cache.exp | ||
cell.exp | ||
cl_util.c | ||
cl_util.h | ||
compiler.c | ||
compiler.cc | ||
cp-support.exp | ||
d-support.exp | ||
dtrace.exp | ||
dwarf.exp | ||
fortran.exp | ||
future.exp | ||
gdb-guile.exp | ||
gdb-python.exp | ||
gdb-utils.exp | ||
gdb.exp | ||
gdbserver-support.exp | ||
go.exp | ||
java.exp | ||
mi-support.exp | ||
objc.exp | ||
opencl.exp | ||
opencl_hostapp.c | ||
opencl_kernel.cl | ||
pascal.exp | ||
pdtrace.in | ||
perftest.exp | ||
prelink-support.exp | ||
prompt.exp | ||
range-stepping-support.exp | ||
read1.c | ||
selftest-support.exp | ||
set_unbuffered_mode.c | ||
trace-support.exp | ||
unbuffer_output.c |