Call postMortem() when a test fails.
authorTim Newsome <tim@sifive.com>
Tue, 12 Sep 2017 18:21:06 +0000 (11:21 -0700)
committerTim Newsome <tim@sifive.com>
Thu, 14 Sep 2017 19:32:59 +0000 (12:32 -0700)
debug/testlib.py
env

index c41c332c8ebf26500b3639b61989a39d1f9746c8..bb81cfb5b105be1eb5e928968213370ba485c180 100644 (file)
@@ -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
index 1b76fd1f1c63dfe4cea93f426434a7384d2bf801..db0bfa223142e56b17dae6d92610f195014bbb80 160000 (submodule)
--- a/env
+++ b/env
@@ -1 +1 @@
-Subproject commit 1b76fd1f1c63dfe4cea93f426434a7384d2bf801
+Subproject commit db0bfa223142e56b17dae6d92610f195014bbb80