From: Maciej W. Rozycki Date: Thu, 24 Oct 2013 22:32:30 +0000 (+0100) Subject: testsuite: Persistent gdbserver cleanup X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a35cfb4007cee8cb84106412cd17f4e12f13345b;p=binutils-gdb.git testsuite: Persistent gdbserver cleanup * lib/gdb.exp (gdb_finish): Send a kill request to `gdbserver' if in the persistent mode. * gdb.trace/disconnected-tracing.exp: Reconnect before completion. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 003208dfa6a..40391c9bafc 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-10-24 Maciej W. Rozycki + + * lib/gdb.exp (gdb_finish): Send a kill request to `gdbserver' + if in the persistent mode. + * gdb.trace/disconnected-tracing.exp: Reconnect before completion. + 2013-10-24 Maciej W. Rozycki * lib/gdb.exp (gdb_gcore_cmd): Also handle a "Target does not diff --git a/gdb/testsuite/gdb.trace/disconnected-tracing.exp b/gdb/testsuite/gdb.trace/disconnected-tracing.exp index 7598d8a7fa0..2f443243fb4 100644 --- a/gdb/testsuite/gdb.trace/disconnected-tracing.exp +++ b/gdb/testsuite/gdb.trace/disconnected-tracing.exp @@ -147,3 +147,6 @@ proc disconnected_tfind { } { } disconnected_tfind + +# Reconnect for a clean gdbserver shutdown. +gdb_reconnect diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index e4a613422bb..4bfa4b4fe65 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3612,8 +3612,23 @@ proc gdb_init { args } { } proc gdb_finish { } { + global gdbserver_reconnect_p + global gdb_prompt global cleanfiles + # Give persistent gdbserver a chance to terminate before GDB is killed. + if {[info exists gdbserver_reconnect_p] && $gdbserver_reconnect_p} { + send_gdb "kill\n"; + gdb_expect 10 { + -re "y or n" { + send_gdb "y\n"; + exp_continue; + } + -re "$gdb_prompt $" { + } + } + } + # Exit first, so that the files are no longer in use. gdb_exit