On Tue, 17 Nov 2026 07:41:57 GMT, Alan Bateman <[email protected]> wrote:

>> src/jdk.jdi/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java line 
>> 41:
>> 
>>> 39:  * declaring the field is being initialized by the event thread and the 
>>> class
>>> 40:  * declares strictly-initialized static fields.
>>> 41:  * <p>
>> 
>> The JVMTI spec makes is clear that this applies when then object is in slot 
>> 0:
>> 
>> "...and slot 0 of the local variable array contains a reference to the 
>> object containing the watched field."
>> 
>> We are missing that here, and instead refer to the object being constructed, 
>> which might not in slot 0.
>
> The JDI spec is more "user facing" and doesn't currently speak of slot 0, 
> e.g. StackFrame::thisObject is specified to return "this" without getting 
> into the possibility of funky bytecode that overwrites slot 0. The intent 
> with the updates to the JDI request and event classes is to keep the docs at 
> the same level. I can add a sentence if you think we need it, in which case 
> it would go into the JDWP spec too.

This was my understanding too from previous spec discussions that the JDI spec 
is more "user facing" and does not speak of slot 0. :)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33841#discussion_r4597286073

Reply via email to