aboutsummaryrefslogtreecommitdiff
path: root/debug
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2018-05-14 15:14:47 -0700
committerTim Newsome <tim@sifive.com>2018-05-14 15:14:47 -0700
commite0ce10a4148d4087e46252584b85b2fff3a0dbd7 (patch)
tree16ee4212a1356d9e9f2de968e6dc77c62f841985 /debug
parent67500e2f200619bcd8ca3a8e5d396ea3021a7e27 (diff)
downloadriscv-tests-e0ce10a4148d4087e46252584b85b2fff3a0dbd7.zip
riscv-tests-e0ce10a4148d4087e46252584b85b2fff3a0dbd7.tar.gz
riscv-tests-e0ce10a4148d4087e46252584b85b2fff3a0dbd7.tar.bz2
Make DownloadTest properly park other harts.
Diffstat (limited to 'debug')
-rwxr-xr-xdebug/gdbserver.py3
-rw-r--r--debug/testlib.py11
2 files changed, 9 insertions, 5 deletions
diff --git a/debug/gdbserver.py b/debug/gdbserver.py
index 98eb818..dd30a3d 100755
--- a/debug/gdbserver.py
+++ b/debug/gdbserver.py
@@ -830,10 +830,11 @@ class DownloadTest(GdbTest):
self.binary = self.target.compile(self.hart, self.download_c.name,
"programs/checksum.c")
- self.gdb.command("file %s" % self.binary)
+ self.gdb.global_command("file %s" % self.binary)
def test(self):
self.gdb.load()
+ self.parkOtherHarts()
self.gdb.command("b _exit")
self.gdb.c()
assertEqual(self.gdb.p("status"), self.crc)
diff --git a/debug/testlib.py b/debug/testlib.py
index 0fe0322..0a6c185 100644
--- a/debug/testlib.py
+++ b/debug/testlib.py
@@ -857,10 +857,8 @@ class GdbTest(BaseTest):
del self.gdb
BaseTest.classTeardown(self)
-class GdbSingleHartTest(GdbTest):
- def classSetup(self):
- GdbTest.classSetup(self)
-
+ def parkOtherHarts(self):
+ """Park harts besides the currently selected one in loop_forever()."""
for hart in self.target.harts:
# Park all harts that we're not using in a safe place.
if hart != self.hart:
@@ -868,6 +866,11 @@ class GdbSingleHartTest(GdbTest):
self.gdb.p("$pc=loop_forever")
self.gdb.select_hart(self.hart)
+class GdbSingleHartTest(GdbTest):
+ def classSetup(self):
+ GdbTest.classSetup(self)
+ self.parkOtherHarts()
+
class ExamineTarget(GdbTest):
def test(self):
for hart in self.target.harts: