| Summary: | Method reference parameter value shown as null in Inspect but has value in Variables view | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Irina Marudina <public> | ||||||||||
| Component: | Debug | Assignee: | JDT-Debug-Inbox <jdt-debug-inbox> | ||||||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | public, register.eclipse, sarika.sinha | ||||||||||
| Version: | 4.7 | ||||||||||||
| Target Milestone: | --- | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Windows 7 | ||||||||||||
| Whiteboard: | stalebug | ||||||||||||
| Attachments: |
|
||||||||||||
Created attachment 269355 [details]
"target" right before use
Created attachment 269356 [details]
Inspect of "target" right before use
Created attachment 269357 [details]
Hover on "target" right after use
I am not bale to reproduce this problem, I can hover, inspect and see the value in expression view. I have used latest Photon build. Can you try on the latest build ? Have you tried to reproduce it on 4.7 Oxygen? I have tested on two separate Windows machines and it gives the same behavior as explained. I can reproduce it (on the master). Further observation: when I create the Thread with a Runnable object - the same target == null is observed. The problem does not appear when launching the test with java 9. So it looks like this is a jre problem and not an eclipse bug. I've found the problem: As visible in the screenshot in the variables view, the parameter is called "arg0" (probably the java 8 rt.jar isn't compiled with debug information). But Thread has a field named target, so its value is printed instead. Seems like a reasonable explanation to me. Still there is something confusing - after the line "this.target = target;" is executed, "target" argument is shown by Eclipse as changing from null to a valid reference. I guess it now shows the newly set value of "this.target" instead of arg1. If the debug info is missing, shouldn't the value of "target" argument stay unknown for the whole debug session? (In reply to Irina Marudina from comment #10) > Seems like a reasonable explanation to me. Still there is something > confusing - after the line "this.target = target;" is executed, "target" > argument is shown by Eclipse as changing from null to a valid reference. I > guess it now shows the newly set value of "this.target" instead of arg1. > > If the debug info is missing, shouldn't the value of "target" argument stay > unknown for the whole debug session? If the identifier was unknown, no hover would be shown at all. Field names are always known to the run time. So it is always the value of the "target" field that is shown here. I've debugged a bit, the "arg0" is created in org.eclipse.jdi.internal.MethodImpl.inferArguments() Shouldn't the debugger differentiate between field this.target and argument target? If it did, no hover/inspect/watch would be possible for the argument when debug info is missing in the jar. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
Created attachment 269354 [details] Step into Thread's constructor Steps to reproduce: 1. Debug the following program with breakpoint inside the corresponding Thread's constructor: --- public class ConcurrentGreeter { public void greet() { System.out.println("Hello, world!"); } public static void main(String[] args) { ConcurrentGreeter greeter = new ConcurrentGreeter(); Thread t = new Thread(greeter::greet); t.start(); } } --- 2. Hover over "target" parameter inside Thread's constructor 3. Add "target" to Expressions view 4. Inspect "target" parameter value Actual behavior: Hover gives value "null", Expression view shows "null", inspect gives an alert: "Error evaluating: -1" Expected behavior: Hover, Expressions and Inspect of "target" should give the same value as shown in Variables view for the corresponding parameter(arg0), which is not null. In my case it was "ConcurrentGreeter$$Lambda$1/1749186397@1761e840". Further investigation: When I continue debugging inside the Thread's "private void init(ThreadGroup g, Runnable target, String name, long stackSize, AccessControlContext acc)" method, right after line "this.target = target;", the value of target switches from null to the one shown in Variables view. It can now be correctly seen on hover and in Expressions. After this execution point, I can now also Inspect the "target" in the previous stack frames.