aboutsummaryrefslogtreecommitdiff
path: root/debug/testlib.py
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2020-05-18 14:43:01 -0700
committerGitHub <noreply@github.com>2020-05-18 14:43:01 -0700
commitbc4c1d2866b896f6234d19111993fae4a9f47d74 (patch)
tree9ced15a5f4ea159d0d37cfbd68e72019cb350ac1 /debug/testlib.py
parent92c91718ae46f28441018e1d4054a196f381a412 (diff)
downloadriscv-tests-bc4c1d2866b896f6234d19111993fae4a9f47d74.zip
riscv-tests-bc4c1d2866b896f6234d19111993fae4a9f47d74.tar.gz
riscv-tests-bc4c1d2866b896f6234d19111993fae4a9f47d74.tar.bz2
Parse "cannot insert breakpoint" message. (#279)
Also use sys.exit instead of exit, per new pylint's suggestion.
Diffstat (limited to 'debug/testlib.py')
-rw-r--r--debug/testlib.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/debug/testlib.py b/debug/testlib.py
index 36f1f17..bd83d56 100644
--- a/debug/testlib.py
+++ b/debug/testlib.py
@@ -263,7 +263,7 @@ class Openocd:
self.config_file = find_file(config)
if self.config_file is None:
print("Unable to read file", config)
- exit(1)
+ sys.exit(1)
cmd += ["-f", self.config_file]
if debug:
@@ -379,6 +379,11 @@ class CannotAccess(Exception):
Exception.__init__(self)
self.address = address
+class CannotInsertBreakpoint(Exception):
+ def __init__(self, number):
+ Exception.__init__(self)
+ self.number = number
+
class CouldNotFetch(Exception):
def __init__(self, regname, explanation):
Exception.__init__(self)
@@ -412,6 +417,8 @@ def tokenize(text):
lambda m: CouldNotFetch(m.group(1), m.group(2))),
(r"Cannot access memory at address (0x[0-9a-f]+)",
lambda m: CannotAccess(int(m.group(1), 0))),
+ (r"Cannot insert breakpoint (\d+).",
+ lambda m: CannotInsertBreakpoint(int(m.group(1)))),
(r'No symbol "(\w+)" in current context.',
lambda m: NoSymbol(m.group(1))),
(r'"([^"]*)"', lambda m: m.group(1)),