aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2017-07-03 10:48:58 -0700
committerTim Newsome <tim@sifive.com>2017-07-03 10:48:58 -0700
commitcfe2798748bd8fa4db21124026ad4ea35e310006 (patch)
treec1f5d2332d8b9a024d02880bf77e86281aecb442
parenta744e98f528355335801d9a434fb95f8ad4a5aed (diff)
downloadriscv-tests-cfe2798748bd8fa4db21124026ad4ea35e310006.zip
riscv-tests-cfe2798748bd8fa4db21124026ad4ea35e310006.tar.gz
riscv-tests-cfe2798748bd8fa4db21124026ad4ea35e310006.tar.bz2
Add gdb_setup to target for arbitrary gdb commands
I'm using this for a target where misa is at an old address, to set riscv use_compressed_breakpoints off
-rw-r--r--debug/targets.py4
-rw-r--r--debug/testlib.py3
2 files changed, 7 insertions, 0 deletions
diff --git a/debug/targets.py b/debug/targets.py
index 1f4b176..ae81517 100644
--- a/debug/targets.py
+++ b/debug/targets.py
@@ -30,6 +30,10 @@ class Target(object):
# save a little time.
misa = None
+ # List of commands that should be executed in gdb after connecting but
+ # before starting the test.
+ gdb_setup = []
+
# Internal variables:
directory = None
temporary_files = []
diff --git a/debug/testlib.py b/debug/testlib.py
index f511088..c44a763 100644
--- a/debug/testlib.py
+++ b/debug/testlib.py
@@ -622,6 +622,9 @@ class GdbTest(BaseTest):
thread = random.choice(self.gdb.threads())
self.gdb.thread(thread)
+ for cmd in self.target.gdb_setup:
+ self.gdb.command(cmd)
+
# FIXME: OpenOCD doesn't handle PRIV now
#self.gdb.p("$priv=3")