diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-07-01 00:19:25 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-07-01 00:19:25 +0000 |
commit | db863c4274ad1ea4f04feafe45540cc1c3dc7e4f (patch) | |
tree | 16f4e88578f45bf611379801a14001138148b246 /gdb/testsuite/lib | |
parent | 5429523ed4a140a870c4ea8dde0e0efd03435c26 (diff) | |
download | binutils-gdb-db863c4274ad1ea4f04feafe45540cc1c3dc7e4f.tar.gz |
gdb: tests: set remotetimeout to gdb_load_timeout for remote targets
Rather than relying on the default remotetimeout value (which might be
too small for some slower devices), use the existing gdb_load_timeout
config option to set it.
This adds two new helpers for getting/setting the remotetimout to keep
the new logic simple.
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index dc16cfae360..d69527d9d64 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3606,6 +3606,33 @@ proc get_sizeof { type default } { return [get_integer_valueof "sizeof (${type})" $default] } +# Get the current value for remotetimeout and return it. +proc get_remotetimeout { } { + global gdb_prompt + global decimal + + gdb_test_multiple "show remotetimeout" "" { + -re "Timeout limit to wait for target to respond is ($decimal).*$gdb_prompt $" { + return $expect_out(1,string); + } + } + + # Pick the default that gdb uses + warning "Unable to read remotetimeout" + return 300 +} + +# Set the remotetimeout to the specified timeout. Nothing is returned. +proc set_remotetimeout { timeout } { + global gdb_prompt + + gdb_test_multiple "set remotetimeout $timeout" "" { + -re "$gdb_prompt $" { + verbose "Set remotetimeout to $timeout\n" + } + } +} + # Log gdb command line and script if requested. if {[info exists TRANSCRIPT]} { rename send_gdb real_send_gdb |