# HG changeset patch # User Gary Benson # Date 1232630810 18000 # Node ID 22e3d8f1edc66d66659ae77bbfafd79c7bc5023e # Parent 146e2cc88520b53f5969b975e92a4765b8873fae 2009-01-22 Gary Benson * ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp (print_zero_threads): New debug function. diff -r 146e2cc88520 -r 22e3d8f1edc6 ChangeLog --- 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 + + * ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp + (print_zero_threads): New debug function. + 2009-01-22 Gary Benson * patches/icedtea-cc-interp-jvmti.patch: Reenable thread signalling. diff -r 146e2cc88520 -r 22e3d8f1edc6 ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp --- 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