On Fri, 20 Nov 2026 04:42:54 GMT, Serguei Spitsyn <[email protected]> wrote:

> The jdb can be impacted by changes in behavior and may need an update. Now, 
> the calls to `frame.thisObject()` can throw the `OpaqueFrameException`.

This happens in the java expressions parser, which already has the potential to 
generate exceptions. I don't think anything special or different needs to be 
done when StackFrame.thisObject() throws OpaqueFrameException. It just means if 
the user enters an expression that references "this" in the constructor of a 
strictly initialized type, they will now see an OpaqueFrameException.

> src/jdk.jdi/share/classes/com/sun/jdi/StackFrame.java line 112:
> 
>> 110:      * @return an {@link ObjectReference}, or null if the frame 
>> represents
>> 111:      * a native or static method.
>> 112:      * @throws OpaqueFrameException if the this stack frame is for a 
>> constructor whose
> 
> Nit: A typo: `the this stack frame` => `this stack frame`.

Fixed.

> src/jdk.jdi/share/classes/com/sun/tools/jdi/StackFrameImpl.java line 254:
> 
>> 252:                     throw new InvalidStackFrameException();
>> 253:                 case JDWP.Error.OPAQUE_FRAME:
>> 254:                     throw new InternalException("Unexpected 
>> OPAQUE_FRAME error");
> 
> Nit: This needs a short comment about why is is unexpected. Say something 
> that `OPAQUE_FRAME` can be returned for slot 0 which has to be filtered out 
> from the list of locals.

Fixed.

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

PR Comment: https://git.openjdk.org/jdk/pull/33977#issuecomment-7043994066
PR Review Comment: https://git.openjdk.org/jdk/pull/33977#discussion_r4644508610
PR Review Comment: https://git.openjdk.org/jdk/pull/33977#discussion_r4644496077

Reply via email to