+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
continue
}
}
+ timeout {
+ error "Timeout waiting for gdbserver response."
+ }
}
break
}
}
# 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
}
}
- 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]
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"
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]
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]
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]