Bug 72183 - editing variables in debugger
Summary: editing variables in debugger
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: CPP Debugger (show other bugs)
Version: git master
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-08 20:33 UTC by Jon Smirl
Modified: 2005-07-18 12:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Smirl 2004-01-08 20:33:41 UTC
Version:           CVS (using KDE Devel)

there is no UI for editing variables in the debugger. There should be a right click command for edit that pops up a dialog.

I know about using a watch expression to do this.
Comment 1 Jens Dagerbo 2004-01-08 20:40:47 UTC
Let's see.. wish?
Comment 2 jakubpol 2004-08-20 02:13:58 UTC
A better way (though I don't know if it's possible) would be if one could directly edit either the expression or its value (by just left-clicking on it, it would get selected and highlighted, pressing any key would delete it and enter this key).

I think if that option were implemented the debugger would become much much more functional.

Regards,
Jakub
Comment 3 Vladimir Prus 2005-07-18 12:27:46 UTC
SVN commit 435822 by vprus:

Implement editing expression/variable values in variables window.

Now, by clicking on variable value user can edit it, and after pressing
enter the value is changed in the program.

This patch works fine, with exception of two things:

1. User can try to edit rvalue (say, value of "1+1"). Gdb does not allow
to query if value is editable so we have no way to prevent it. So, in this
case we need to display an error message and mark the expression as 
non-editable. 

(Note that in MI mode, we theoretically can query if var is editable, 
but gdb mistakenly reports that "1+1" is editable, so this is of no help).

2. It's possible to set the value of array with "{1, 2}". However, standard
   display of arrays does not show such composite value -- it only shows
   values of each individual element. Need to either show composite value
   in all cases, or clean the value column after value is assigned.

As a side effect, this patch makes clicking "-" on a expanded pointer
variable show again the pointer value, as opposed to pointed-to value.

* variablewidget.h
  (VariableTree::setValue): New signal
  (VariableTree::slotDoubleClicked,
   VariableTree::handleDoubleClicked): Remove for now, as
        this code was unused.
  (VarItem::originalName): New method.

* variablewidget.cpp:
  (VarItem::setOpen): Reload the value when closing item.

* gdbcontroller.h
  gdbcontroller.cpp
  (GDBController::slotSetValue): New slot.

 
BUG: 72183
CCMAIL: kdevelop-devel@kdevelop.org



 M  +4 -0      debuggerpart.cpp  
 M  +4 -1      gdbcommand.h  
 M  +17 -2     gdbcontroller.cpp  
 M  +7 -0      gdbcontroller.h  
 M  +46 -49    variablewidget.cpp  
 M  +11 -10    variablewidget.h