gdb/testsuite/sim: Remove redundant setting of timeout
authorAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 4 Dec 2018 11:29:47 +0000 (11:29 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 5 Dec 2018 11:53:28 +0000 (11:53 +0000)
In the config/sim.exp file two functions are defined.  Both of these
functions define local timeout variables and then call gdb_expect,
which (through a call to get_largest_timeout) will find the local
definition of timeout.

However, both of these functions set the local timeout to some
arbitrary value and print a log message for this "new" timeout just
before returning.

As in both cases, the timeout is a local variable, this final setting
of the timeout has no effect and can be removed.

As having log messages about the timeout being adjusted could cause
confusion I've removed all logging related to timeouts in this
function, timeouts are adjusted throughout the testsuite without any
logging, there doesn't seem to be any good reason why these functions
should get their own logging.

With the logging gone there seems to be little need to a local timeout
variable at all, and so I've folded the local timeout directly into
the call to gdb_expect.

gdb/testsuite/ChangeLog:

* config/sim.exp (gdb_target_sim): Remove redundant adjustment of
local timeout variable before return, and remove all local timeout
variable entirely.
(gdb_load): Likewise.

gdb/testsuite/ChangeLog
gdb/testsuite/config/sim.exp

index 3935ee67d1d5fdfa5f93ba52caac0659c3449b60..66310d79f46c5f3d5036ec1546b818a57fb04fbd 100644 (file)
@@ -1,3 +1,10 @@
+2018-12-05  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * config/sim.exp (gdb_target_sim): Remove redundant adjustment of
+       local timeout variable before return, and remove all local timeout
+       variable entirely.
+       (gdb_load): Likewise.
+
 2018-12-01  Tom de Vries  <tdevries@suse.de>
 
        * gdb.base/gdb-caching-proc.exp: New file.
index d9072febc6a7029bdff97e3132e2ea33ffa2334b..fd4d506ebb839191c5e114c23f0f8516a303abe1 100644 (file)
@@ -26,9 +26,7 @@ proc gdb_target_sim { } {
     set target_sim_options "[board_info target gdb,target_sim_options]"
 
     send_gdb "target sim $target_sim_options\n"
-    set timeout 60
-    verbose "Timeout is now $timeout seconds" 2
-    gdb_expect {
+    gdb_expect 60 {
        -re "Connected to the simulator.*$gdb_prompt $" {
            verbose "Set target to sim"
        }
@@ -37,8 +35,6 @@ proc gdb_target_sim { } {
            return -1
        }
     }
-    set timeout 10
-    verbose "Timeout is now $timeout seconds" 2
     return 0
 }
 
@@ -60,15 +56,11 @@ proc gdb_load { arg } {
     if [gdb_target_sim] then { return -1 }
 
     send_gdb "load\n"
-    set timeout 2400
-    verbose "Timeout is now $timeout seconds" 2
-    gdb_expect {
+    gdb_expect 2400 {
        -re ".*$gdb_prompt $" {
            if $verbose>1 then {
                send_user "Loaded $arg into $GDB\n"
            }
-           set timeout 30
-           verbose "Timeout is now $timeout seconds" 2
            return 0
        }
        -re "$gdb_prompt $"     {
This page took 0.053144 seconds and 4 git commands to generate.