RFR: 8294547: HotSpotAgent.setupVM() should include "cause" exception when throwing DebuggerException

Coleen Phillimore coleenp at openjdk.org
Thu Sep 29 17:48:37 UTC 2022


On Wed, 28 Sep 2022 22:38:44 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

> In `HotSpotAgent.setupVM()`, if there is an underlying exception in the vm setup, the exception is consumed and a `DebuggerException` is thrown, hiding the root cause. When throwing the `DebuggerException`, the "cause" exception should be included. This provides a more detailed exception stack trace, such as the following:
> 
> 
> Doesn't appear to be a HotSpot VM (could not find symbol "gHotSpotVMTypes" in
> remote process)
> sun.jvm.hotspot.debugger.DebuggerException: Doesn't appear to be a HotSpot VM (could not find symbol "gHotSpotVMTypes" in remote process)
> at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:428)
> at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:338)
> at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:158)
> at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.attachDebugger(CLHSDB.java:210)
> at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.run(CLHSDB.java:69)
> at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.main(CLHSDB.java:44)
> at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runCLHSDB(SALauncher.java:281)
> at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:500)
> Caused by: sun.jvm.hotspot.debugger.NoSuchSymbolException: Could not find symbol "gHotSpotVMTypes" in any of the known library names (jvm.dll)
> at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotTypeDataBase.lookupInProcess(HotSpotTypeDataBase.java:622)
> at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotTypeDataBase.readVMTypes(HotSpotTypeDataBase.java:154)
> at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotTypeDataBase.<init>(HotSpotTypeDataBase.java:89)
> at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:407)
> ... 7 more 
> 
> 
> I'd like to push this as a trivial change.

Thank you!

-------------

Marked as reviewed by coleenp (Reviewer).

PR: https://git.openjdk.org/jdk/pull/10474


More information about the serviceability-dev mailing list