From aph at redhat.com Wed Aug 2 10:23:26 2017 From: aph at redhat.com (Andrew Haley) Date: Wed, 2 Aug 2017 11:23:26 +0100 Subject: Handy hint: how to single step and breakpoint Zero's bytecode interpreter Message-ID: Sometimes you need to set a breakpoint inside the JVM, to be triggered when executing a particular method. This is very tricky with Zero, especially when the interpreter was compiled with full optimization. This patch is a fairly lightweight way to do that. If you set the environment variable JVM_TARGET_METHOD with your method name and (optionally) the bytecode index, this will print the method name, the BCI, and the contents of the expression stack: java.util.HashMap.resize()[Ljava/util/HashMap$Node; 139 0x7fffae1a85e8 java.util.HashMap.resize()[Ljava/util/HashMap$Node; 141 0x7fffae1a85e8 0x7fffae1a8660 If you run HotSpot in GDB and place a breakpoint on the asm("nop") this will print the location and stop the interpreter in the debugger. http://cr.openjdk.java.net/~aph/c%2b%2binterpreter-breakpoint.patch -- Andrew Haley Java Platform Lead Engineer Red Hat UK Ltd. EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671