From: Tim Newsome Date: Mon, 3 Jul 2017 17:48:58 +0000 (-0700) Subject: Add gdb_setup to target for arbitrary gdb commands X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cfe2798748bd8fa4db21124026ad4ea35e310006;p=riscv-tests.git 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 --- 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")