aboutsummaryrefslogtreecommitdiff
path: root/debug/targets.py
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2023-05-25 10:05:41 -0700
committerTim Newsome <tim@sifive.com>2023-05-25 10:05:41 -0700
commitaf242299624f602d380985d9850cf7d433e11840 (patch)
treef4d4d3c88549ea96daa812799f67824476a46afd /debug/targets.py
parent557762fc480fdbd2bc06a0b045cf0d6e12dbdfd4 (diff)
downloadriscv-tests-af242299624f602d380985d9850cf7d433e11840.zip
riscv-tests-af242299624f602d380985d9850cf7d433e11840.tar.gz
riscv-tests-af242299624f602d380985d9850cf7d433e11840.tar.bz2
debug: New pylint => new warnings => new cleanups
- Replace general "Exception" with "GdbServerError" in gdbserver.py for when no samples are collected - Replace general "Exception" with "TargetsException" in targets.py for XLEN mismatch - Introduce "TestLibError" exception in testlib.py and replace general exceptions in various locations - Update pylint.rc to remove overgeneral-exceptions warning
Diffstat (limited to 'debug/targets.py')
-rw-r--r--debug/targets.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/debug/targets.py b/debug/targets.py
index ddd39d5..0ba12db 100644
--- a/debug/targets.py
+++ b/debug/targets.py
@@ -256,6 +256,9 @@ def add_target_options(parser):
"the same time. This may make it harder to debug a failure if it "
"does occur.")
+class TargetsException(Exception):
+ pass
+
def target(parsed):
directory = os.path.dirname(parsed.target)
filename = os.path.basename(parsed.target)
@@ -278,7 +281,7 @@ def target(parsed):
if h.xlen == 0:
h.xlen = parsed.xlen
elif h.xlen != parsed.xlen:
- raise Exception("The target hart specified an XLEN of "
+ raise TargetsException("The target hart specified an XLEN of "
f"{h.xlen}, but the command line specified an XLEN of "
f"{parsed.xlen}. They must match.")