diff options
author | Tim Newsome <tim@sifive.com> | 2018-08-31 12:53:25 -0700 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2018-08-31 12:53:25 -0700 |
commit | 705c51ef7c478d537c6c7c391b0e3442810a7114 (patch) | |
tree | fd87fa7ff71f8e31485b2d2ce69f83a3b8c0a9da | |
parent | 4dddbc79ada7f0a836cf538676c57c8df103ccf6 (diff) | |
download | riscv-tests-705c51ef7c478d537c6c7c391b0e3442810a7114.zip riscv-tests-705c51ef7c478d537c6c7c391b0e3442810a7114.tar.gz riscv-tests-705c51ef7c478d537c6c7c391b0e3442810a7114.tar.bz2 |
Fix CustomRegisterTest.
gdb in riscv-tools doesn't automatically create a "custom" group like
mainline gdb does.
-rwxr-xr-x | debug/gdbserver.py | 3 | ||||
-rw-r--r-- | debug/testlib.py | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/debug/gdbserver.py b/debug/gdbserver.py index c362e1d..1d58f76 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -142,7 +142,8 @@ class CustomRegisterTest(SimpleRegisterTest): return self.target.implements_custom_test def check_custom(self, magic): - regs = self.gdb.info_registers("custom") + regs = {k: v for k, v in self.gdb.info_registers("all").iteritems() + if k.startswith("custom")} assertEqual(set(regs.keys()), set(("custom1", "custom12345", diff --git a/debug/testlib.py b/debug/testlib.py index 6adc43a..59440b3 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -556,12 +556,12 @@ class Gdb(object): output = self.command("info registers %s" % group) result = {} for line in output.splitlines(): + parts = line.split() + name = parts[0] if "Could not fetch" in line: - name, value = line.split(None, 1) + result[name] = " ".join(parts[1:]) else: - name, hex_value, _ = line.split(None, 2) - value = int(hex_value, 0) - result[name] = value + result[name] = int(parts[1], 0) return result def stepi(self): |