aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-05-23 12:41:14 +0000
committerDaniel Jacobowitz <drow@false.org>2007-05-23 12:41:14 +0000
commit2226f861d20ac90ed2dc31b0f602c63e3f84c818 (patch)
treedeab836faf89710286ddcdc43ec0a33c05857a04 /gdb
parentab14ee8d0c8f64de6487735ef1e33ccbf3bea3c3 (diff)
downloadgdb-2226f861d20ac90ed2dc31b0f602c63e3f84c818.zip
gdb-2226f861d20ac90ed2dc31b0f602c63e3f84c818.tar.gz
gdb-2226f861d20ac90ed2dc31b0f602c63e3f84c818.tar.bz2
* lib/gdbserver-support.exp (gdbserver_spawn): Only match full_buffer.
(gdbserver_run): Kill any running gdbserver. * lib/mi-support.exp (mi_gdb_target_load): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/lib/gdbserver-support.exp17
-rw-r--r--gdb/testsuite/lib/mi-support.exp1
3 files changed, 23 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 1f0fdd3..3b882ca 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-23 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * lib/gdbserver-support.exp (gdbserver_spawn): Only match full_buffer.
+ (gdbserver_run): Kill any running gdbserver.
+ * lib/mi-support.exp (mi_gdb_target_load): Likewise.
+
2007-05-17 Maciej W. Rozycki <macro@mips.com>
* gdb.base/sigbpt.exp: Preset segv_addr.
diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp
index 0a8b111..4d8f049 100644
--- a/gdb/testsuite/lib/gdbserver-support.exp
+++ b/gdb/testsuite/lib/gdbserver-support.exp
@@ -222,7 +222,7 @@ proc gdbserver_spawn { child_args } {
# don't need to redirect output.
expect_background {
-i $server_spawn_id
- -re "." { }
+ full_buffer { }
eof {
# The spawn ID is already closed now (but not yet waited for).
wait -i $expect_out(spawn_id)
@@ -236,6 +236,21 @@ proc gdbserver_spawn { child_args } {
# to it. Return 0 on success, or non-zero on failure.
proc gdbserver_run { child_args } {
+ # Kill anything running before we try to start gdbserver, in case
+ # we are sharing a serial connection.
+ global gdb_prompt
+ send_gdb "kill\n"
+ gdb_expect 120 {
+ -re "Kill the program being debugged. .y or n. $" {
+ send_gdb "y\n"
+ verbose "\t\tKilling previous program being debugged"
+ exp_continue
+ }
+ -re "$gdb_prompt $" {
+ # OK.
+ }
+ }
+
set res [gdbserver_spawn $child_args]
set protocol [lindex $res 0]
set gdbport [lindex $res 1]
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 6763ff5..c1381a5 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -454,6 +454,7 @@ proc mi_gdb_target_load { } {
upvar timeout timeout
if { [info procs gdbserver_gdb_load] != "" } {
+ mi_gdb_test "kill" ".*" ""
set res [gdbserver_gdb_load]
set protocol [lindex $res 0]
set gdbport [lindex $res 1]