aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2017-09-12 11:21:06 -0700
committerTim Newsome <tim@sifive.com>2017-09-14 12:32:59 -0700
commit706b6476a2eb320a84fef39716a7c19a83b68a39 (patch)
tree188f6b5d2ce8a693eb851813676df2cb739482c2
parentb6bc6a7c84188d2be78c69a345c884f76e7b4c38 (diff)
downloadriscv-tests-706b6476a2eb320a84fef39716a7c19a83b68a39.zip
riscv-tests-706b6476a2eb320a84fef39716a7c19a83b68a39.tar.gz
riscv-tests-706b6476a2eb320a84fef39716a7c19a83b68a39.tar.bz2
Call postMortem() when a test fails.
-rw-r--r--debug/testlib.py10
m---------env13
2 files changed, 15 insertions, 8 deletions
diff --git a/debug/testlib.py b/debug/testlib.py
index c41c332..bb81cfb 100644
--- a/debug/testlib.py
+++ b/debug/testlib.py
@@ -588,6 +588,9 @@ class BaseTest(object):
del self.server
del self.target_process
+ def postMortem(self):
+ pass
+
def run(self):
"""
If compile_args is set, compile a program and set self.binary.
@@ -621,6 +624,7 @@ class BaseTest(object):
print e.message
header("Traceback")
traceback.print_exc(file=sys.stdout)
+ self.postMortem()
return result
finally:
@@ -665,6 +669,12 @@ class GdbTest(BaseTest):
# FIXME: OpenOCD doesn't handle PRIV now
#self.gdb.p("$priv=3")
+ def postMortem(self):
+ if not self.gdb:
+ return
+ self.gdb.interrupt()
+ self.gdb.command("info registers all", timeout=10)
+
def classTeardown(self):
del self.gdb
BaseTest.classTeardown(self)
diff --git a/env b/env
-Subproject 1b76fd1f1c63dfe4cea93f426434a7384d2bf80
+Subproject db0bfa223142e56b17dae6d92610f195014bbb8