Accepting jdwp connection early enough to debug Graal startup with -Xcomp

Alan Bateman Alan.Bateman at oracle.com
Wed Aug 28 12:11:39 UTC 2019


On 28/08/2019 10:58, Doug Simon wrote:
> Hi Gary,
>
> I’ve noticed the same thing myself and have not yet found a good solution. It would be nice to know what the definitive point is in VM startup after which JDWP debugging is “on”. I’ve cc’ed Alan Bateman who may be able to offer some insight (or redirect to someone who can).
>
The debugger agent can accept or establish a connection to the debugger 
once the VM is initialized. In Thread::create_vm look for 
JvmtiExport::post_vm_initialized. So yes, some code will execute in 
initPhase1, initPhase2, and initPhase3 prior to this. Are you expecting 
JVMCI to be initialized and the Graal compiler to be invoked to compile 
this code? The VM can't load classes outside of java.base until module 
system is initialized in initPhase2 so I don't think a Graal compiler in 
Java can be used until after that. Maybe things change with libgraal. To 
support debugging of Java code that is executed before the live phase 
would require surgery in the JDWP agent and maybe additional support in 
JVM TI as many of the functions and events are only defined for the live 
phase.

-Alan




More information about the graal-dev mailing list