changeset 1325:22e3d8f1edc6

2009-01-22 Gary Benson <gbenson@redhat.com> * ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp (print_zero_threads): New debug function.
author Gary Benson <gbenson@redhat.com>
date Thu, 22 Jan 2009 08:26:50 -0500
parents 146e2cc88520
children 6bf9d2398902
files ChangeLog ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp
diffstat 2 files changed, 28 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jan 22 08:24:50 2009 -0500
+++ b/ChangeLog	Thu Jan 22 08:26:50 2009 -0500
@@ -1,3 +1,8 @@
+2009-01-22  Gary Benson  <gbenson@redhat.com>
+
+	* ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp
+	(print_zero_threads): New debug function.
+
 2009-01-22  Gary Benson  <gbenson@redhat.com>
 
 	* patches/icedtea-cc-interp-jvmti.patch: Reenable thread signalling.
--- a/ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp	Thu Jan 22 08:24:50 2009 -0500
+++ b/ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp	Thu Jan 22 08:26:50 2009 -0500
@@ -37,13 +37,13 @@
   {
     intptr_t *lo_addr = thread->zero_stack()->sp();
     if (!lo_addr) {
-      _st->print(" stack not set up");
+      _st->print_cr(" stack not set up");
       return;
     }
 
     intptr_t *hi_addr = (intptr_t *) thread->top_zero_frame();
     if (!hi_addr) {
-      _st->print("no frames pushed"); 
+      _st->print_cr("no frames pushed"); 
       return;
     }
     assert(hi_addr >= lo_addr, "corrupted stack");
@@ -250,3 +250,24 @@
       _st->print_cr(PTR_FORMAT, *addr);    
   }
 };
+
+#ifndef PRODUCT
+extern "C" {
+  void print_zero_threads() {
+    char buf[O_BUFLEN];
+    ZeroStackPrinter zsp(tty, buf, sizeof(buf));
+
+    for (JavaThread *t = Threads::first(); t; t = t->next()) {
+      tty->print(PTR_FORMAT, t);
+      tty->print(" ");
+      t->print_on_error(tty, buf, sizeof(buf));
+      tty->cr();
+      tty->cr();
+
+      zsp.print(t);
+      if (t->next())
+        tty->cr();
+    }
+  }
+}
+#endif // !PRODUCT