Bug 325494 - Add "Instance watches"
Summary: Add "Instance watches"
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-16 12:49 EDT by Adam Dyga CLA
Modified: 2010-09-16 13:52 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 Adam Dyga CLA 2010-09-16 12:49:17 EDT
Build Identifier: 

It would be very nice to add "instance watches" to the debugger. For example, during debugging session, is should be possible to right-click an object reference in the source and choose "Instance watch" from popup menu (similar to current "Watch"). After that, the state of this particular object would be displayed in Expressions window as long as the application is running and the object is in the memory (ie. not garbage collected), *irrespective of the scope* later on.
This would be very useful in code areas where the desired object is not easily accessible (eg. insanely long watch expressions required) or not accessible at all (happens too).

As a convenience feature, it would also be nice to have a kind of "Instance watch trigger", which would be placed on a reference variable in a specific source code line. When the program execution reaches the line, the instance watch would be automatically added to the Expressions window. This way it wouldn't be necessary to add the instance watch manually at the beginning of each debugging session.

Reproducible: Always
Comment 1 Darin Wright CLA 2010-09-16 13:00:03 EDT
The first half of this request already exists. You can run an evaluation in the debugger (inspect) and persist that result in the expresions view (by pressing Ctrl-Shift-I again). This places the actual expression result - object or value - into the expression view rather than the source expression used to generate the result. The icon for such an expression is also different - a magnifying glass. The object/value remains until the VM terminates.

The second half is, of course, an enhancement request.
Comment 2 Adam Dyga CLA 2010-09-16 13:06:53 EDT
Thanks for the tip, I missed this feature somehow!
Comment 3 Adam Dyga CLA 2010-09-16 13:44:18 EDT
BTW. Is pressing Ctrl-Shift-I twice the only way to achieve this? I think many users may miss it, adding an extra popup menu option would still be useful.
Comment 4 Darin Wright CLA 2010-09-16 13:52:43 EDT
From the variables view you can just use the "Inspect" action - that puts the selected object directly into the expressions view. There is no context menu in the inspect pop-up currently, so this would also be an enhancement request.