On Tue, 17 Oct 2023 21:37:05 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:

>> Yes, so the current way is probably ok?
>> 
>> IDEs like IntelliJ properly handle the exception event that is sent and 
>> don't report an error, so I don't see a problem.
>
>> On the other hand, I think if the debug agent requires that a handler be in 
>> place (as a result of the debugger creating and enabling the EventRequest) 
>> in order for onthrow to send the event, then the handler creation might come 
>> too late, and the event will get filtered out.
> 
> I was thinking that maybe suspend=y is the way around this for the debugger. 
> This will cause the debug agent to do a SUSPEND_ALL before sending the 
> ExceptionEvent. However, the event could still be received by the debugger 
> before the debugger has setup the ExceptionRequest. The only thing suspend=y 
> is really doing here is ensuring that all threads get suspended when the 
> event is generated. In fact that makes it even more important that the 
> debugger process the event. Otherwise it won't be doing eventSet.resume(), 
> and execution will come to a stand still.
> 
> I think we might just be stuck with what we have now. My main concern then is 
> that it is neither spec'd nor documented well. I'll file a separate CR to 
> cover that.

I'm happy to help with any documentation efforts, as the lack of proper 
documentation is probably one of the reasons why the adoption was so low over 
the last twenty years.

The documentation should tell the potential users about the possible issues 
with this option.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16145#discussion_r1362829727

Reply via email to