This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 0/6] Introduce $inferior_spawn_id, make interrupt.exp work with GDBserver


After fixing a gdbserver syscall restart issue, I thought of adding a
new test to exercise syscall restarting.  Then I recalled that we
already have interrupt.exp for that.  However, that test is skipped on
gdbserver, because it relies on inferior i/o.

When testing with gdbserver, inferior are spawned by gdbserver, on
gdbserver's pty, and so gdb_test_multiple/gdb_expect, don't see the
inferior's i/o.

This series introduces a mechanism that allows tests to match inferior
i/o separately from gdb i/o, like:

  send_inferior "echo me\n"
  gdb_test_multiple "continue" "test msg" {
    -i "$inferior_spawn_id" -re "echo me\r\necho\r\n" {
      ...
    }
    -i "$gdb_spawn_id" -re "error.*$gdb_prompt $" {
      ...
    }
  }

and then adjusts interrupt.exp to use the new mechanism.

I took the idea from Don Breazeal's use of $server_spawn_id here
<https://sourceware.org/ml/gdb-patches/2015-01/msg00689.html>, and
generalized it.

A couple bugs had to be fixed along the way, and I took the change to
clean up interrupt.exp to use gdb_test_multiple instead of gdb_expect
too.  interrupt.exp now passes against gdbserver here, on x86_64
Fedora 20 (It fails with gdbserver/-m32 testing in the exact same way
it fails on native/-m32 testing, due to a kernel bug).

Pedro Alves (6):
  gdb.base/interrupt.exp: Fix race
  gdb.base/interrupt.exp: Use gdb_test_multiple instead of gdb_expect
  gdb_test_multiple: Fix user code argument processing
  testsuite: Don't use expect_background to reap gdbserver
  testsuite: Introduce $inferior_spawn_id
  gdb.base/interrupt.exp: Use send_inferior/$inferior_spawn_id

 gdb/testsuite/gdb.base/interrupt.exp    | 141 +++++++++++++++++++-------------
 gdb/testsuite/lib/gdb.exp               |  67 +++++++++++----
 gdb/testsuite/lib/gdbserver-support.exp |  68 ++++++++++++---
 3 files changed, 188 insertions(+), 88 deletions(-)

-- 
1.9.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]