Accepting jdwp connection early enough to debug Graal startup with -Xcomp
doug.simon at oracle.com
Wed Aug 28 12:35:18 UTC 2019
Thanks a lot for the input.
My only further comment is that with libgraal, the whole JDWP question is irrelevant as Graal will not be running as Java code (from HotSpot’s perspective).
> On 28 Aug 2019, at 14:11, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 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.
More information about the graal-dev