On Fri, 13 Nov 2026 16:22:50 GMT, Alan Bateman <[email protected]> wrote:
>> Yes great. Wanted a mechanism to make possibly multiple errors available.
>
> Does this mean you'll change it to add it to the suppressed the exception? (I
> wasn't sure how to read your last message).
Yes, joining the Exception messages together was because I wanted a way to not
lose the error messages if two providers fail.
I have updated
src/jdk.attach/share/classes/com/sun/tools/attach/VirtualMachine.java to save
additional Exceptions as a suppressed Exception.
This is going to be rare, but if you had a pid and file clash and neither
worked, you might see something like:
$ jcmd 89308 help
89308:
com.sun.tools.attach.AttachNotSupportedException: pid: 89308 cmd: '-bash' state
is not ready to participate in attach handshake!
at
jdk.attach/sun.tools.attach.VirtualMachineImpl.checkCatchesAndSendQuitTo(VirtualMachineImpl.java:421)
..etc...
at jdk.jcmd/sun.tools.jcmd.JCmd.main(JCmd.java:123)
Suppressed: com.sun.tools.attach.AttachNotSupportedException: Truncated
file '89308'
at
jdk.attach/sun.tools.attach.VirtualMachineCoreDumpImpl.checkCoreFile(VirtualMachineCoreDumpImpl.java:67)
..etc...
at
jdk.attach/sun.tools.attach.CoreDumpAttachProviderImpl.attachVirtualMachine(CoreDumpAttachProviderImpl.java:61)
... 3 more
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31011#discussion_r4566833034