diff options
Diffstat (limited to 'debug/testlib.py')
-rw-r--r-- | debug/testlib.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/debug/testlib.py b/debug/testlib.py index 5c78bd7..58bb23e 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -476,6 +476,11 @@ class CouldNotFetch(Exception): self.regname = regname self.explanation = explanation +class CouldNotReadRegisters(Exception): + def __init__(self, explanation): + Exception.__init__(self) + self.explanation = explanation + class NoSymbol(Exception): def __init__(self, symbol): Exception.__init__(self) @@ -508,6 +513,8 @@ def tokenize(text): (r"<repeats (\d+) times>", lambda m: Repeat(int(m.group(1)))), (r"Could not fetch register \"(\w+)\"; (.*)$", lambda m: CouldNotFetch(m.group(1), m.group(2))), + (r"Could not read registers; (.*)$", + lambda m: CouldNotReadRegisters(m.group(1))), (r"Cannot access memory at address (0x[0-9a-f]+)", lambda m: CannotAccess(int(m.group(1), 0))), (r"Cannot insert breakpoint (\d+).", @@ -857,9 +864,13 @@ class Gdb: result[name] = parse_rhs(parts[1]) return result - def stepi(self): - output = self.command("stepi", ops=10) - return output + def stepi(self, wait=True): + if wait: + return self.command("stepi", ops=10) + else: + self.active_child.sendline("stepi") + self.active_child.expect("stepi", timeout=self.timeout) + return "" def expect(self, text, ops=1): return self.active_child.expect(text, timeout=ops * self.timeout) |