aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@codesourcery.com>2013-10-24 23:32:30 +0100
committerTom Tromey <tromey@sourceware.org>2013-10-25 14:03:00 +0000
commita35cfb4007cee8cb84106412cd17f4e12f13345b (patch)
tree0f3151ee2393b248c9e69b22eb29abca6f9a84ff /gdb/testsuite
parentbbe769cc07aa1b1b0f4ede05c189a2d9897603bb (diff)
downloadgdb-a35cfb4007cee8cb84106412cd17f4e12f13345b.zip
gdb-a35cfb4007cee8cb84106412cd17f4e12f13345b.tar.gz
gdb-a35cfb4007cee8cb84106412cd17f4e12f13345b.tar.bz2
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.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.trace/disconnected-tracing.exp3
-rw-r--r--gdb/testsuite/lib/gdb.exp15
3 files changed, 24 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 003208d..40391c9 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2013-10-24 Maciej W. Rozycki <macro@codesourcery.com>
+ * 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 <macro@codesourcery.com>
+
* lib/gdb.exp (gdb_gcore_cmd): Also handle a "Target does not
support core file generation" reply.
diff --git a/gdb/testsuite/gdb.trace/disconnected-tracing.exp b/gdb/testsuite/gdb.trace/disconnected-tracing.exp
index 7598d8a..2f44324 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 e4a6134..4bfa4b4 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