533 }
534
535
536 extern "C" void universe() {
537 Command c("universe");
538 Universe::print_on(tty);
539 }
540
541
542 extern "C" void verify() {
543 // try to run a verify on the entire system
544 // note: this may not be safe if we're not at a safepoint; for debugging,
545 // this manipulates the safepoint settings to avoid assertion failures
546 Command c("universe verify");
547 bool safe = SafepointSynchronize::is_at_safepoint();
548 if (!safe) {
549 tty->print_cr("warning: not at safepoint -- verify may fail");
550 SafepointSynchronize::set_is_at_safepoint();
551 }
552 // Ensure Eden top is correct before verification
553 Universe::heap()->prepare_for_verify();
554 Universe::verify();
555 if (!safe) SafepointSynchronize::set_is_not_at_safepoint();
556 }
557
558
559 extern "C" void pp(void* p) {
560 Command c("pp");
561 FlagSetting fl(PrintVMMessages, true);
562 FlagSetting f2(DisplayVMOutput, true);
563 if (Universe::heap()->is_in(p)) {
564 oop obj = oop(p);
565 obj->print();
566 } else {
567 tty->print(PTR_FORMAT, p2i(p));
568 }
569 }
570
571
572 // pv: print vm-printable object
573 extern "C" void pa(intptr_t p) { ((AllocatedObj*) p)->print(); }
574 extern "C" void findpc(intptr_t x);
575
576 #endif // !PRODUCT
577
578 extern "C" void ps() { // print stack
579 if (Thread::current_or_null() == NULL) return;
580 Command c("ps");
581
582
583 // Prints the stack of the current Java thread
|
533 }
534
535
536 extern "C" void universe() {
537 Command c("universe");
538 Universe::print_on(tty);
539 }
540
541
542 extern "C" void verify() {
543 // try to run a verify on the entire system
544 // note: this may not be safe if we're not at a safepoint; for debugging,
545 // this manipulates the safepoint settings to avoid assertion failures
546 Command c("universe verify");
547 bool safe = SafepointSynchronize::is_at_safepoint();
548 if (!safe) {
549 tty->print_cr("warning: not at safepoint -- verify may fail");
550 SafepointSynchronize::set_is_at_safepoint();
551 }
552 // Ensure Eden top is correct before verification
553 GC::gc()->heap()->prepare_for_verify();
554 Universe::verify();
555 if (!safe) SafepointSynchronize::set_is_not_at_safepoint();
556 }
557
558
559 extern "C" void pp(void* p) {
560 Command c("pp");
561 FlagSetting fl(PrintVMMessages, true);
562 FlagSetting f2(DisplayVMOutput, true);
563 if (GC::gc()->heap()->is_in(p)) {
564 oop obj = oop(p);
565 obj->print();
566 } else {
567 tty->print(PTR_FORMAT, p2i(p));
568 }
569 }
570
571
572 // pv: print vm-printable object
573 extern "C" void pa(intptr_t p) { ((AllocatedObj*) p)->print(); }
574 extern "C" void findpc(intptr_t x);
575
576 #endif // !PRODUCT
577
578 extern "C" void ps() { // print stack
579 if (Thread::current_or_null() == NULL) return;
580 Command c("ps");
581
582
583 // Prints the stack of the current Java thread
|