Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355195 - Debugger fails to resolve variables in JDK source when running Eclipse Application JUnit test
Summary: Debugger fails to resolve variables in JDK source when running Eclipse Applic...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-19 05:24 EDT by Nicolas Bros CLA
Modified: 2019-11-09 00:39 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Bros CLA 2011-08-19 05:24:43 EDT
I debug an Eclipse Application JUnit 4 test [1]

I put a breakpoint in a method [2] for which I don't have the source in my workspace (it's in the Java rt.jar) but the source attachment (src.zip from the JDK) is configured in Preferences > Java > Installed JREs.

When the debugger stops into the method, I see the Java source of the class (com.sun.org.apache.xerces.internal.impl.XMLEntityManager in my case).

When hovering over variables in the method, I don't see any value.
And when I try Ctrl+D or Ctrl+I on the method parameters or local method variables, I get: xx cannot be resolved as a variable.

In the "Variables" view, I see "this" and "arg0", but not the other local variables, even after I have stepped after their initialization.

I have the source, the debugger is suspended on the breakpoint in the method, and the method is selected in the stack, so I think it should work.


[1]https://dev.eclipse.org/svnroot/modeling/org.eclipse.mdt.modisco/tests/trunk/org.eclipse.modisco.jee.webapp.discoverer.tests/src/org/eclipse/modisco/jee/webapp/discoverer/tests/TestNoUri.java
[2]com.sun.org.apache.xerces.internal.impl.XMLEntityManager#resolveEntityAsPerStax
Comment 1 Nicolas Bros CLA 2011-08-19 05:25:45 EDT
This is with:
Eclipse SDK
Version: 3.7.0
Build id: I20110613-1736
Comment 2 Michael Rennie CLA 2011-08-22 14:20:35 EDT
(In reply to comment #0)
 
> When hovering over variables in the method, I don't see any value.
> And when I try Ctrl+D or Ctrl+I on the method parameters or local method
> variables, I get: xx cannot be resolved as a variable.
> 
> In the "Variables" view, I see "this" and "arg0", but not the other local
> variables, even after I have stepped after their initialization.
> 
> I have the source, the debugger is suspended on the breakpoint in the method,
> and the method is selected in the stack, so I think it should work.

The confusion is because the class files for the JDK are not compiled with the debug attributes. In this case (missing debug attributes) we can show you the source (if you have attached it) and we can assign variables names (arg0, arg1, etc, etc) - but we have no information about what the 'real' names of the variables are. 

The reason the hover does not work is because we try to look up the name of the variable you hover over - the name from the source - and we only know the variables as arg0, arg1, etc.

There is nothing more we can do about the debug attributes not being present, but perhaps we could improve the hover support to somehow resolve which variable to look for a bit better.
Comment 3 Eclipse Genie CLA 2019-11-09 00:39:24 EST
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.

If you have further information on the current state of the bug, please add it. 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.