* 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_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
}
disconnected_tfind
+
+# Reconnect for a clean gdbserver shutdown.
+gdb_reconnect
}
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