1.1 --- a/src/share/vm/utilities/debug.cpp Wed May 15 11:30:54 2013 +0200 1.2 +++ b/src/share/vm/utilities/debug.cpp Fri May 17 08:51:46 2013 -0700 1.3 @@ -665,152 +665,4 @@ 1.4 tty->print_cr(" ndebug() - undo debug"); 1.5 } 1.6 1.7 -#if 0 1.8 - 1.9 -// BobV's command parser for debugging on windows when nothing else works. 1.10 - 1.11 -enum CommandID { 1.12 - CMDID_HELP, 1.13 - CMDID_QUIT, 1.14 - CMDID_HSFIND, 1.15 - CMDID_PSS, 1.16 - CMDID_PS, 1.17 - CMDID_PSF, 1.18 - CMDID_FINDM, 1.19 - CMDID_FINDNM, 1.20 - CMDID_PP, 1.21 - CMDID_BPT, 1.22 - CMDID_EXIT, 1.23 - CMDID_VERIFY, 1.24 - CMDID_THREADS, 1.25 - CMDID_ILLEGAL = 99 1.26 -}; 1.27 - 1.28 -struct CommandParser { 1.29 - char *name; 1.30 - CommandID code; 1.31 - char *description; 1.32 -}; 1.33 - 1.34 -struct CommandParser CommandList[] = { 1.35 - (char *)"help", CMDID_HELP, " Dump this list", 1.36 - (char *)"quit", CMDID_QUIT, " Return from this routine", 1.37 - (char *)"hsfind", CMDID_HSFIND, "Perform an hsfind on an address", 1.38 - (char *)"ps", CMDID_PS, " Print Current Thread Stack Trace", 1.39 - (char *)"pss", CMDID_PSS, " Print All Thread Stack Trace", 1.40 - (char *)"psf", CMDID_PSF, " Print All Stack Frames", 1.41 - (char *)"findm", CMDID_FINDM, " Find a Method* from a PC", 1.42 - (char *)"findnm", CMDID_FINDNM, "Find an nmethod from a PC", 1.43 - (char *)"pp", CMDID_PP, " Find out something about a pointer", 1.44 - (char *)"break", CMDID_BPT, " Execute a breakpoint", 1.45 - (char *)"exitvm", CMDID_EXIT, "Exit the VM", 1.46 - (char *)"verify", CMDID_VERIFY, "Perform a Heap Verify", 1.47 - (char *)"thread", CMDID_THREADS, "Dump Info on all Threads", 1.48 - (char *)0, CMDID_ILLEGAL 1.49 -}; 1.50 - 1.51 - 1.52 -// get_debug_command() 1.53 -// 1.54 -// Read a command from standard input. 1.55 -// This is useful when you have a debugger 1.56 -// which doesn't support calling into functions. 1.57 -// 1.58 -void get_debug_command() 1.59 -{ 1.60 - ssize_t count; 1.61 - int i,j; 1.62 - bool gotcommand; 1.63 - intptr_t addr; 1.64 - char buffer[256]; 1.65 - nmethod *nm; 1.66 - Method* m; 1.67 - 1.68 - tty->print_cr("You have entered the diagnostic command interpreter"); 1.69 - tty->print("The supported commands are:\n"); 1.70 - for ( i=0; ; i++ ) { 1.71 - if ( CommandList[i].code == CMDID_ILLEGAL ) 1.72 - break; 1.73 - tty->print_cr(" %s \n", CommandList[i].name ); 1.74 - } 1.75 - 1.76 - while ( 1 ) { 1.77 - gotcommand = false; 1.78 - tty->print("Please enter a command: "); 1.79 - count = scanf("%s", buffer) ; 1.80 - if ( count >=0 ) { 1.81 - for ( i=0; ; i++ ) { 1.82 - if ( CommandList[i].code == CMDID_ILLEGAL ) { 1.83 - if (!gotcommand) tty->print("Invalid command, please try again\n"); 1.84 - break; 1.85 - } 1.86 - if ( strcmp(buffer, CommandList[i].name) == 0 ) { 1.87 - gotcommand = true; 1.88 - switch ( CommandList[i].code ) { 1.89 - case CMDID_PS: 1.90 - ps(); 1.91 - break; 1.92 - case CMDID_PSS: 1.93 - pss(); 1.94 - break; 1.95 - case CMDID_PSF: 1.96 - psf(); 1.97 - break; 1.98 - case CMDID_FINDM: 1.99 - tty->print("Please enter the hex addr to pass to findm: "); 1.100 - scanf("%I64X", &addr); 1.101 - m = (Method*)findm(addr); 1.102 - tty->print("findm(0x%I64X) returned 0x%I64X\n", addr, m); 1.103 - break; 1.104 - case CMDID_FINDNM: 1.105 - tty->print("Please enter the hex addr to pass to findnm: "); 1.106 - scanf("%I64X", &addr); 1.107 - nm = (nmethod*)findnm(addr); 1.108 - tty->print("findnm(0x%I64X) returned 0x%I64X\n", addr, nm); 1.109 - break; 1.110 - case CMDID_PP: 1.111 - tty->print("Please enter the hex addr to pass to pp: "); 1.112 - scanf("%I64X", &addr); 1.113 - pp((void*)addr); 1.114 - break; 1.115 - case CMDID_EXIT: 1.116 - exit(0); 1.117 - case CMDID_HELP: 1.118 - tty->print("Here are the supported commands: "); 1.119 - for ( j=0; ; j++ ) { 1.120 - if ( CommandList[j].code == CMDID_ILLEGAL ) 1.121 - break; 1.122 - tty->print_cr(" %s -- %s\n", CommandList[j].name, 1.123 - CommandList[j].description ); 1.124 - } 1.125 - break; 1.126 - case CMDID_QUIT: 1.127 - return; 1.128 - break; 1.129 - case CMDID_BPT: 1.130 - BREAKPOINT; 1.131 - break; 1.132 - case CMDID_VERIFY: 1.133 - verify();; 1.134 - break; 1.135 - case CMDID_THREADS: 1.136 - threads();; 1.137 - break; 1.138 - case CMDID_HSFIND: 1.139 - tty->print("Please enter the hex addr to pass to hsfind: "); 1.140 - scanf("%I64X", &addr); 1.141 - tty->print("Calling hsfind(0x%I64X)\n", addr); 1.142 - hsfind(addr); 1.143 - break; 1.144 - default: 1.145 - case CMDID_ILLEGAL: 1.146 - break; 1.147 - } 1.148 - } 1.149 - } 1.150 - } 1.151 - } 1.152 -} 1.153 -#endif 1.154 - 1.155 #endif // !PRODUCT