+2019-09-19 Tom de Vries <tdevries@suse.de>
+
+ * lib/gdbserver-support.exp (gdb_target_cmd_ext): Return 2 (meaning
+ UNSUPPORTED) for 'Network is unreachable' message. Factor out of ...
+ (gdb_target_cmd): ... here.
+ * gdb.server/server-connect.exp: Use gdb_target_cmd_ext, handle return
+ value 2.
+
2019-09-18 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.base/source-dir.exp: Avoid having directory names in test
set gdbserver_gdbport [lindex $res 1]
set test "connect to gdbserver using $sockhost"
- if { [gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport] == 0 } {
+ set res [gdb_target_cmd_ext $gdbserver_protocol $gdbserver_gdbport]
+ if { $res == 0 } {
pass $test
- } else {
+ } elseif { $res == 1 } {
fail $test
+ } else {
+ unsupported $test
}
}
}
#
#
-# gdb_target_cmd
-# Send gdb the "target" command. Returns 0 on success, 1 on failure.
+# gdb_target_cmd_ext
+# Send gdb the "target" command. Returns 0 on success, 1 on failure, 2 on
+# unsupported.
# If specified, then ADDITIONAL_TEXT must match the text that comes after
# the connection message in order for the procedure to succeed.
#
-proc gdb_target_cmd { targetname serialport {additional_text ""} } {
+proc gdb_target_cmd_ext { targetname serialport {additional_text ""} } {
global gdb_prompt
set serialport_re [string_to_regexp $serialport]
# Leave it there for the test to diagnose.
return 1
}
+ -re ": Network is unreachable.\r\n.*$gdb_prompt $" {
+ return 2
+ }
timeout {
send_gdb "\ 3"
break
return 1
}
+# Like gdb_target_cmd_ext, but returns 0 on success, 1 on failure.
+
+proc gdb_target_cmd { $args } {
+ set res [gdb_target_cmd_ext $args]
+ return [expr $res == 0 ? 0 : 1]
+}
global portnum
set portnum "2345"