X-Git-Url: https://git.libre-soc.org/?p=riscv-tests.git;a=blobdiff_plain;f=debug%2Ftestlib.py;h=7727f10d5af2947b8b2ec3de39fd74d5f3185a45;hp=c6bf59cfddad690eb3b35d2474b88cc94e996725;hb=6d97e25f4da3e92dee131b1836184836ef280b26;hpb=c2e2e06836b597d983c98f33a7ea38e8e4889935 diff --git a/debug/testlib.py b/debug/testlib.py index c6bf59c..7727f10 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -329,6 +329,12 @@ class CannotAccess(Exception): Exception.__init__(self) self.address = address +class CouldNotFetch(Exception): + def __init__(self, regname, explanation): + Exception.__init__(self) + self.regname = regname + self.explanation = explanation + Thread = collections.namedtuple('Thread', ('id', 'description', 'target_id', 'name', 'frame')) @@ -514,6 +520,9 @@ class Gdb(object): m = re.search("Cannot access memory at address (0x[0-9a-f]+)", output) if m: raise CannotAccess(int(m.group(1), 0)) + m = re.search(r"Could not fetch register \"(\w+)\"; (.*)$", output) + if m: + raise CouldNotFetch(m.group(1), m.group(2)) rhs = output.split('=')[-1] return self.parse_string(rhs)