583 WizardMode = true;
584 PrintVMMessages = PrintCompilation = true;
585 PrintInlining = PrintAssembly = true;
586 tty->flush();
587 }
588
589
590 extern "C" void ndebug() { // undo debug()
591 Command c("ndebug");
592 PrintCompilation = false;
593 PrintInlining = PrintAssembly = false;
594 tty->flush();
595 }
596
597
598 extern "C" void flush() {
599 Command c("flush");
600 tty->flush();
601 }
602
603
604 // Given a heap address that was valid before the most recent GC, if
605 // the oop that used to contain it is still live, prints the new
606 // location of the oop and the address. Useful for tracking down
607 // certain kinds of naked oop and oop map bugs.
608 extern "C" void pnl(intptr_t old_heap_addr) {
609 // Print New Location of old heap address
610 Command c("pnl");
611 #ifndef VALIDATE_MARK_SWEEP
612 tty->print_cr("Requires build with VALIDATE_MARK_SWEEP defined (debug build) and RecordMarkSweepCompaction enabled");
613 #else
614 MarkSweep::print_new_location_of_heap_address((HeapWord*) old_heap_addr);
615 #endif
616 }
617
618
619 extern "C" methodOop findm(intptr_t pc) {
620 Command c("findm");
621 nmethod* nm = CodeCache::find_nmethod((address)pc);
622 return (nm == NULL) ? (methodOop)NULL : nm->method();
742
743
744 // int versions of all methods to avoid having to type type casts in the debugger
745
746 void pp(intptr_t p) { pp((void*)p); }
747 void pp(oop p) { pp((void*)p); }
748
749 void help() {
750 Command c("help");
751 tty->print_cr("basic");
752 tty->print_cr(" pp(void* p) - try to make sense of p");
753 tty->print_cr(" pv(intptr_t p)- ((PrintableResourceObj*) p)->print()");
754 tty->print_cr(" ps() - print current thread stack");
755 tty->print_cr(" pss() - print all thread stacks");
756 tty->print_cr(" pm(int pc) - print methodOop given compiled PC");
757 tty->print_cr(" findm(intptr_t pc) - finds methodOop");
758 tty->print_cr(" find(intptr_t x) - finds & prints nmethod/stub/bytecode/oop based on pointer into it");
759
760 tty->print_cr("misc.");
761 tty->print_cr(" flush() - flushes the log file");
762 tty->print_cr(" events() - dump last 50 events");
763
764
765 tty->print_cr("compiler debugging");
766 tty->print_cr(" debug() - to set things up for compiler debugging");
767 tty->print_cr(" ndebug() - undo debug");
768 }
769
770 #if 0
771
772 // BobV's command parser for debugging on windows when nothing else works.
773
774 enum CommandID {
775 CMDID_HELP,
776 CMDID_QUIT,
777 CMDID_HSFIND,
778 CMDID_PSS,
779 CMDID_PS,
780 CMDID_PSF,
781 CMDID_FINDM,
782 CMDID_FINDNM,
|
583 WizardMode = true;
584 PrintVMMessages = PrintCompilation = true;
585 PrintInlining = PrintAssembly = true;
586 tty->flush();
587 }
588
589
590 extern "C" void ndebug() { // undo debug()
591 Command c("ndebug");
592 PrintCompilation = false;
593 PrintInlining = PrintAssembly = false;
594 tty->flush();
595 }
596
597
598 extern "C" void flush() {
599 Command c("flush");
600 tty->flush();
601 }
602
603 extern "C" void events() {
604 Command c("events");
605 Events::print();
606 }
607
608 // Given a heap address that was valid before the most recent GC, if
609 // the oop that used to contain it is still live, prints the new
610 // location of the oop and the address. Useful for tracking down
611 // certain kinds of naked oop and oop map bugs.
612 extern "C" void pnl(intptr_t old_heap_addr) {
613 // Print New Location of old heap address
614 Command c("pnl");
615 #ifndef VALIDATE_MARK_SWEEP
616 tty->print_cr("Requires build with VALIDATE_MARK_SWEEP defined (debug build) and RecordMarkSweepCompaction enabled");
617 #else
618 MarkSweep::print_new_location_of_heap_address((HeapWord*) old_heap_addr);
619 #endif
620 }
621
622
623 extern "C" methodOop findm(intptr_t pc) {
624 Command c("findm");
625 nmethod* nm = CodeCache::find_nmethod((address)pc);
626 return (nm == NULL) ? (methodOop)NULL : nm->method();
746
747
748 // int versions of all methods to avoid having to type type casts in the debugger
749
750 void pp(intptr_t p) { pp((void*)p); }
751 void pp(oop p) { pp((void*)p); }
752
753 void help() {
754 Command c("help");
755 tty->print_cr("basic");
756 tty->print_cr(" pp(void* p) - try to make sense of p");
757 tty->print_cr(" pv(intptr_t p)- ((PrintableResourceObj*) p)->print()");
758 tty->print_cr(" ps() - print current thread stack");
759 tty->print_cr(" pss() - print all thread stacks");
760 tty->print_cr(" pm(int pc) - print methodOop given compiled PC");
761 tty->print_cr(" findm(intptr_t pc) - finds methodOop");
762 tty->print_cr(" find(intptr_t x) - finds & prints nmethod/stub/bytecode/oop based on pointer into it");
763
764 tty->print_cr("misc.");
765 tty->print_cr(" flush() - flushes the log file");
766 tty->print_cr(" events() - dump events from ring buffers");
767
768
769 tty->print_cr("compiler debugging");
770 tty->print_cr(" debug() - to set things up for compiler debugging");
771 tty->print_cr(" ndebug() - undo debug");
772 }
773
774 #if 0
775
776 // BobV's command parser for debugging on windows when nothing else works.
777
778 enum CommandID {
779 CMDID_HELP,
780 CMDID_QUIT,
781 CMDID_HSFIND,
782 CMDID_PSS,
783 CMDID_PS,
784 CMDID_PSF,
785 CMDID_FINDM,
786 CMDID_FINDNM,
|