"onthrow" and "onuncaught" are documented here:
https://docs.oracle.com/en/java/javase/17/docs/specs/jpda/conninv.html#oracle-vm-invocation-options
Some improvements are needed:
1. The "onthrow" syntax is "onthrow=<execption name>". There is no mention of this in the documentation for this option (it is mentioned in the help output), although there is one example properly showing its use.
2. Using either option requires that the "launch" option also be used to launch the debugger to attach to. However, it turns out you can already have a debugger launched and ready to attach, yet you still need to specify "launch" or the debug agent will fail to initialize. This happens when also using "suspend=y" indicating that the debug agent should listen for the debugger attach, which may have been initiated by the debugger before the debuggee was even launched. Using "launch=exit" can be done in this case. It would be good to document this.
There may be other suggestions for improvements. Please feel free to add to this list in the description.
https://docs.oracle.com/en/java/javase/17/docs/specs/jpda/conninv.html#oracle-vm-invocation-options
Some improvements are needed:
1. The "onthrow" syntax is "onthrow=<execption name>". There is no mention of this in the documentation for this option (it is mentioned in the help output), although there is one example properly showing its use.
2. Using either option requires that the "launch" option also be used to launch the debugger to attach to. However, it turns out you can already have a debugger launched and ready to attach, yet you still need to specify "launch" or the debug agent will fail to initialize. This happens when also using "suspend=y" indicating that the debug agent should listen for the debugger attach, which may have been initiated by the debugger before the debuggee was even launched. Using "launch=exit" can be done in this case. It would be good to document this.
There may be other suggestions for improvements. Please feel free to add to this list in the description.
- relates to
-
JDK-8318564 Debug agent "onthrow" and "onuncaught" arguments rely on unspecified JDWP and JDI behavior.
-
- Open
-
-
JDK-8317920 JDWP-agent sends broken exception event with onthrow option
-
- Resolved
-