Bug 321289 - Expressions -> Create watch should regard context
Summary: Expressions -> Create watch should regard context
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-30 02:45 EDT by Lysathor CLA
Modified: 2010-07-30 10:18 EDT (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 Lysathor CLA 2010-07-30 02:45:25 EDT
During debugging: In "Expressions" open tree of an object (e.g. "myobj"). Select a field of that class (e.g. "myfield"). Click with mouse right button and select "Watch". This results in a watch expression "myfield" that does not work because the context is not inside the class.
The created watch should be "myobj.myfield" instead of "myfield".

Example
MyObj
{
 public int myfield=0;
}

void test()
{
MyObj myobj = new MyObj();
//add breakpoint here
int x = myobj.myfield;
}


Another wish:
Additionally Drag & Drop of a field in "Expressions" should work the same way and create an expression for that field (currently no expression is created).

Another wish:
"Expressions" should honor "Detail Formatters". "Variables" does.




-- Configuration Details --
Product: Eclipse 1.3.0.20100617-0520 (org.eclipse.epp.package.java.product)
Installed Features:
 org.eclipse.jdt 3.6.0.v20100526-0800-7z8XFUJFMTfCWGoVuHImpms9H155
Comment 1 Darin Wright CLA 2010-07-30 10:18:13 EDT
Note: the platform's APIs for creation watch expressions currently pass in the selected object/variable in the tree, but we'd need to have the platform pass in the IStructuredSelection (possibly a TreeSelection) in order to determine the path to the variable (since variable's don't have back pointers).