aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMegan Wachs <megan@sifive.com>2017-11-02 08:46:24 -0700
committerGitHub <noreply@github.com>2017-11-02 08:46:24 -0700
commit82da8bccd1903c766f3a29f2b6a671cc059f0bce (patch)
treef0a4ecc13fe604a6a107b2583cd5cd0fc5488c7c
parentf281625313e9ebd7bcae918ae4abe8bd0bd63b81 (diff)
downloadriscv-tests-82da8bccd1903c766f3a29f2b6a671cc059f0bce.zip
riscv-tests-82da8bccd1903c766f3a29f2b6a671cc059f0bce.tar.gz
riscv-tests-82da8bccd1903c766f3a29f2b6a671cc059f0bce.tar.bz2
debug: Need to apply remotetimeout before connecting to remote target (#94)
* debug: Need to apply remotetimeout before connecting to remote target * debug: whitespace cleanup
-rw-r--r--debug/testlib.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/debug/testlib.py b/debug/testlib.py
index fae2132..f6643ac 100644
--- a/debug/testlib.py
+++ b/debug/testlib.py
@@ -314,6 +314,7 @@ class Gdb(object):
def __init__(self, ports,
cmd=os.path.expandvars("$RISCV/bin/riscv64-unknown-elf-gdb"),
+ timeout=60,
binary=None):
assert ports
@@ -340,6 +341,7 @@ class Gdb(object):
self.command("set height 0")
# Force consistency.
self.command("set print entry-values no")
+ self.command("set remotetimeout %d" % timeout)
self.command("target extended-remote localhost:%d" % port)
if binary:
self.command("file %s" % binary)
@@ -757,16 +759,15 @@ class GdbTest(BaseTest):
BaseTest.classSetup(self)
if gdb_cmd:
- self.gdb = Gdb(self.server.gdb_ports, gdb_cmd, binary=self.binary)
+ self.gdb = Gdb(self.server.gdb_ports, gdb_cmd, timeout=self.target.timeout_sec, binary=self.binary)
else:
- self.gdb = Gdb(self.server.gdb_ports, binary=self.binary)
+ self.gdb = Gdb(self.server.gdb_ports, timeout=self.target.timeout_sec, binary=self.binary)
self.logs += self.gdb.lognames()
- if self.target:
- self.gdb.global_command("set arch riscv:rv%d" % self.hart.xlen)
- self.gdb.global_command("set remotetimeout %d" %
- self.target.timeout_sec)
+ self.gdb.global_command("set arch riscv:rv%d" % self.hart.xlen)
+ self.gdb.global_command("set remotetimeout %d" %
+ self.target.timeout_sec)
for cmd in self.target.gdb_setup:
self.gdb.command(cmd)