456 |
456 |
457 STEP(130, "(printing Java stack)" ) |
457 STEP(130, "(printing Java stack)" ) |
458 |
458 |
459 if (_verbose && _thread && _thread->is_Java_thread()) { |
459 if (_verbose && _thread && _thread->is_Java_thread()) { |
460 JavaThread* jt = (JavaThread*)_thread; |
460 JavaThread* jt = (JavaThread*)_thread; |
|
461 #ifdef ZERO |
|
462 if (jt->zero_stack()->sp() && jt->top_zero_frame()) { |
|
463 // StackFrameStream uses the frame anchor, which may not have |
|
464 // been set up. This can be done at any time in Zero, however, |
|
465 // so if it hasn't been set up then we just set it up now and |
|
466 // clear it again when we're done. |
|
467 bool has_last_Java_frame = jt->has_last_Java_frame(); |
|
468 if (!has_last_Java_frame) |
|
469 jt->set_last_Java_frame(); |
|
470 st->print("Java frames:"); |
|
471 |
|
472 // If the top frame is a Shark frame and the frame anchor isn't |
|
473 // set up then it's possible that the information in the frame |
|
474 // is garbage: it could be from a previous decache, or it could |
|
475 // simply have never been written. So we print a warning... |
|
476 StackFrameStream sfs(jt); |
|
477 if (!has_last_Java_frame && !sfs.is_done()) { |
|
478 if (sfs.current()->zeroframe()->is_shark_frame()) { |
|
479 st->print(" (TOP FRAME MAY BE JUNK)"); |
|
480 } |
|
481 } |
|
482 st->cr(); |
|
483 |
|
484 // Print the frames |
|
485 for(int i = 0; !sfs.is_done(); sfs.next(), i++) { |
|
486 sfs.current()->zero_print_on_error(i, st, buf, sizeof(buf)); |
|
487 st->cr(); |
|
488 } |
|
489 |
|
490 // Reset the frame anchor if necessary |
|
491 if (!has_last_Java_frame) |
|
492 jt->reset_last_Java_frame(); |
|
493 } |
|
494 #else |
461 if (jt->has_last_Java_frame()) { |
495 if (jt->has_last_Java_frame()) { |
462 st->print_cr("Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)"); |
496 st->print_cr("Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)"); |
463 for(StackFrameStream sfs(jt); !sfs.is_done(); sfs.next()) { |
497 for(StackFrameStream sfs(jt); !sfs.is_done(); sfs.next()) { |
464 sfs.current()->print_on_error(st, buf, sizeof(buf)); |
498 sfs.current()->print_on_error(st, buf, sizeof(buf)); |
465 st->cr(); |
499 st->cr(); |
466 } |
500 } |
467 } |
501 } |
|
502 #endif // ZERO |
468 } |
503 } |
469 |
504 |
470 STEP(140, "(printing VM operation)" ) |
505 STEP(140, "(printing VM operation)" ) |
471 |
506 |
472 if (_verbose && _thread && _thread->is_VM_thread()) { |
507 if (_verbose && _thread && _thread->is_VM_thread()) { |