On Thu, 7 May 2026 10:29:13 GMT, Alan Bateman <[email protected]> wrote:
>> Kevin Walls has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> TableStatistics not static, remove Windows special case
>
> src/jdk.attach/share/classes/com/sun/tools/attach/spi/AttachProvider.java
> line 144:
>
>> 142: * Attach to a Java virtual machine.
>> 143: *
>> 144: * Details as per the {@link attachVirtualMachine(String)} method.
>
> "Details as per ..." is too casual and I assume temporary.
>
> As per the API, I don't think env should allowed to be null. Additionally, if
> env is empty then this method can invoke the 1-arg attachVirtualMachine
> method. This will require an implSpec to document this for implementers.
Updated the API doc.
I've implemented the new new attachVirtualMachine(String vmid, Map<String, ?>
env) method in
HotSpotAttachProvider, the common parent of platform-specific
AttachProviderImpl classes.
The new method will create a VirtualMachineCoreDumpImpl for a core/minidump.
The single-arg attachVirtualMachine method is in all the platform specific
subclasses, e.g.
src/jdk.attach/linux/classes/sun/tools/attach/AttachProviderImpl.java
and those existing methods won't attach to a core dump, they create the usual
new VirtualMachineImpl(this, vmid);
So the 2-arg method can't call the 1 arg attachVirtualMachine(String vmid),
unless I go change the linux and Windows subclasses to support 1-arg attach to
a core.
I was thinking the 2-arg attachVirtualMachine(String vmid, Map<String, ?> env)
would be THE way of attaching to a core.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31011#discussion_r3203527121