Patchwork [PULL,v5,10/12] lm32_sys: dump cpu state if test case fails

login
register
mail settings
Submitter Michael Walle
Date Feb. 4, 2014, 6:58 p.m.
Message ID <1391540314-16141-11-git-send-email-michael@walle.cc>
Download mbox | patch
Permalink /patch/316737/
State New
Headers show

Comments

Michael Walle - Feb. 4, 2014, 6:58 p.m.
This will ease debugging the test cases.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 hw/misc/lm32_sys.c |    3 +++
 1 file changed, 3 insertions(+)

Patch

diff --git a/hw/misc/lm32_sys.c b/hw/misc/lm32_sys.c
index b2e157c..e394f2e 100644
--- a/hw/misc/lm32_sys.c
+++ b/hw/misc/lm32_sys.c
@@ -82,6 +82,9 @@  static void sys_write(void *opaque, hwaddr addr,
         testname = (char *)s->testname;
         fprintf(stderr, "TC  %-*s %s\n", MAX_TESTNAME_LEN,
                 testname, (value) ? "FAILED" : "OK");
+        if (value) {
+            cpu_dump_state(qemu_get_cpu(0), stderr, fprintf, 0);
+        }
         break;
     case R_TESTNAME:
         s->regs[addr] = value;