diff options
author | Pedro Alves <palves@redhat.com> | 2015-04-07 18:19:30 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2015-04-07 18:28:38 +0100 |
commit | f71c18e755dac28c61a5e5c94fbc8a84eb573679 (patch) | |
tree | 6fe77f411bef994213c7e43c959b681f3fbd8c9e /gdb/go32-nat.c | |
parent | 6423214fcb912a5d402ffcb84d6f61f2b900a900 (diff) | |
download | gdb-f71c18e755dac28c61a5e5c94fbc8a84eb573679.zip gdb-f71c18e755dac28c61a5e5c94fbc8a84eb573679.tar.gz gdb-f71c18e755dac28c61a5e5c94fbc8a84eb573679.tar.bz2 |
testsuite: Introduce $inferior_spawn_id
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.
Diffstat (limited to 'gdb/go32-nat.c')
0 files changed, 0 insertions, 0 deletions