aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/ChangeLog11
-rw-r--r--gdb/testsuite/lib/gdbserver-support.exp26
-rw-r--r--gdb/testsuite/lib/mi-support.exp5
3 files changed, 36 insertions, 6 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 4d2933c..0691c46 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,16 @@
2014-09-09 Maciej W. Rozycki <macro@codesourcery.com>
+ * lib/gdbserver-support.exp (gdbserver_start): Throw an error
+ exception on timeout.
+ (gdbserver_run): Catch any `gdbserver_spawn' error exceptions.
+ (gdbserver_start_extended): Catch any `gdbserver_start' error
+ exceptions.
+ (gdbserver_start_multi, mi_gdbserver_start_multi): Likewise.
+ * lib/mi-support.exp (mi_gdb_target_load): Catch any
+ `gdbserver_gdb_load' error exceptions.
+
+2014-09-09 Maciej W. Rozycki <macro@codesourcery.com>
+
* lib/gdbserver-support.exp (gdbserver_start): Set timeout to
120 on waiting for the TCP socket to open.
diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp
index e3cae63..026a937 100644
--- a/gdb/testsuite/lib/gdbserver-support.exp
+++ b/gdb/testsuite/lib/gdbserver-support.exp
@@ -287,6 +287,9 @@ proc gdbserver_start { options arguments } {
continue
}
}
+ timeout {
+ error "Timeout waiting for gdbserver response."
+ }
}
break
}
@@ -326,7 +329,8 @@ proc gdbserver_spawn { child_args } {
}
# Start a gdbserver process running HOST_EXEC and pass CHILD_ARGS
-# to it. Return 0 on success, or non-zero on failure.
+# to it. Return 0 on success, or non-zero on failure: 2 if gdbserver
+# failed to start or 1 if we couldn't connect to it.
proc gdbserver_run { child_args } {
global gdbserver_protocol
@@ -347,7 +351,10 @@ proc gdbserver_run { child_args } {
}
}
- set res [gdbserver_spawn $child_args]
+ if { [catch { gdbserver_spawn $child_args } res] == 1 } {
+ perror $res
+ return 2
+ }
set gdbserver_protocol [lindex $res 0]
set gdbserver_gdbport [lindex $res 1]
@@ -377,7 +384,10 @@ proc gdbserver_start_extended { } {
global gdbserver_gdbport
global use_gdb_stub
- set res [gdbserver_start "--multi" ""]
+ if { [catch { gdbserver_start "--multi" "" } res] == 1 } {
+ perror $res
+ return 2
+ }
set gdbserver_protocol [lindex $res 0]
if { [string first "extended-" $gdbserver_protocol] != 0} {
set gdbserver_protocol "extended-$gdbserver_protocol"
@@ -399,7 +409,10 @@ proc gdbserver_start_multi { } {
global gdbserver_protocol
global gdbserver_gdbport
- set res [gdbserver_start "--multi" ""]
+ if { [catch { gdbserver_start "--multi" "" } res] == 1 } {
+ perror $res
+ return 2
+ }
set gdbserver_protocol [lindex $res 0]
set gdbserver_gdbport [lindex $res 1]
@@ -414,7 +427,10 @@ proc mi_gdbserver_start_multi { } {
global gdbserver_protocol
global gdbserver_gdbport
- set res [gdbserver_start "--multi" ""]
+ if { [catch { gdbserver_start "--multi" "" } res] == 1 } {
+ perror $res
+ return 2
+ }
set gdbserver_protocol [lindex $res 0]
set gdbserver_gdbport [lindex $res 1]
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 204f1e8..a7f7aef 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -477,7 +477,10 @@ proc mi_gdb_target_load { } {
if { [info procs gdbserver_gdb_load] != "" } {
mi_gdb_test "kill" ".*" ""
- set res [gdbserver_gdb_load]
+ if { [catch gdbserver_gdb_load res] == 1 } {
+ perror $res
+ return -1
+ }
set protocol [lindex $res 0]
set gdbport [lindex $res 1]