How to print all thread's stack
Gan Xiaojun <[email protected]> Thu, 29 Jul 2004 19:43:35 -0600
| Newsgroups | gmane.comp.java.sun.cldc |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
I want to print all thread's stack so I change the function
void Java_java_lang_Throwable_printStackTrace(Thread* THREAD) {
UsingFastOops fast_oops;
JavaFrame frame(THREAD);
Throwable::Fast throwable = frame.local_at(0)->as_obj();
throwable().print_stack_trace();
}
to
/*I want to call this function in native function, so I remove THREAD*/
void Java_java_lang_Throwable_printStackTrace0() {
printf("vvvvvvvvvvvvvvvvvvvvvvvvvvv\r\n");
Thread::Raw thread = Universe::global_threadlist();
while (thread.not_null()) {
UsingFastOops fast_oops;
JavaFrame frame(&thread());
Throwable::Fast throwable = frame.local_at(0)->as_obj();
throwable().print_stack_trace();
thread = thread().global_next();
}
printf("^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n");
}
But it always fails
Any suggestion is welcomed.
gan
===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff CLDC-FEEDBACK". For general help, send email to
[email protected] and include in the body of the message "help".