Bug 247172 - Watch expression cannot be edited
Summary: Watch expression cannot be edited
Status: REOPENED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 5.0   Edit
Hardware: Other Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-12 11:08 EDT by Vladimir Prus CLA
Modified: 2020-09-04 15:19 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Prus CLA 2008-09-12 11:08:41 EDT
Create a hello, world program, and add a global variable "int foobar;" to that problem as well. Build and launch it under debugger. Right click the source, select "add watch expression" and type 'foobar' as the name. The "Expressions" window appears. Right click on the 'foobar' there, and observe "Change Value" menu item, grayed out.

An expression can be either lvalue or rvalue, and lvalues should be editable via UI. One can use GDB -var-show-attributes command to discover is a variable object is editable or not.
Comment 1 Nobody - feel free to take it CLA 2008-09-12 13:44:18 EDT
The enablement of "Change Value" depends on IValueModification interface. The WatchExpression object created by "Add Watch Expression" command doesn't implement IValueModification interface. This code is part of the Platform and we don't have access to it.
cc-ing to platform for comment.
Comment 2 Darin Wright CLA 2008-09-12 13:53:48 EDT
The platform models a watch expression as an expression that changes value based on the context in which it is evaluated. It is not something that is assigned a value - the value comes from the evaluation.
Comment 3 Pawel Piech CLA 2008-09-12 14:14:46 EDT
I can't resist making a shameless plug for DSF, which does support editing in the Expressions view...  For standard debug model/CDI, it's probably safe to mark it as WONTFIX.
Comment 4 Nobody - feel free to take it CLA 2008-09-12 15:39:41 EDT
If DSF can do it, we can do it too :). Marking as "enhancement".
Comment 5 Pawel Piech CLA 2008-09-12 15:58:33 EDT
(In reply to comment #4)
Wisely you speak :-)  I definitely won't deny that it's possible.