From: Tim Newsome Date: Fri, 31 Aug 2018 19:53:25 +0000 (-0700) Subject: Fix CustomRegisterTest. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=705c51ef7c478d537c6c7c391b0e3442810a7114;p=riscv-tests.git Fix CustomRegisterTest. gdb in riscv-tools doesn't automatically create a "custom" group like mainline gdb does. --- 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):