[PATCH] Improved variables view
Vladimir Prus
ghost at cs.msu.su
Tue Jun 14 18:27:34 UTC 2005
Hello!
Attached is the patch that implements most of my suggestions for the variables
view.
Now on variables in the current frame are shown. It's possible to either
evaluate an expression, or add a watch. The list of recently evaluated
expressions is shown in the variables view, and it's possible to change a
name of such expression to something more memorable.
Additionally, I've somewhat refactored interaction between gdbcontroller and
variablewidget. Previously, gdbcontroller called a large number of vartree
functions, now most interaction is done with signals, which I find a bit
cleaner.
What I did not yet do is changing variables right in var widget, but my patch
has grown long enough already ;-)
A couple of snapshots are
http://zigzag.cs.msu.su/~ghost/variables_during_debugging.png
http://zigzag.cs.msu.su/~ghost/variables_popup.png
Comments are very welcome!
- Volodya
Log message:
1. Do not immediately switch frames and hide framestack widget, when
opening an item corresponding to a frame. Switch frame only when frame
item is explicitly selected.
See
http://barney.cs.uni-potsdam.de/mailman/private/kdevelop-devel/2005-May/033098.html
for rationale.
2. Show only variables for the current frame in variables view
3. Allow to either evaluate an expression, and add it to the list of watched
expressions.
4. Refactor communication between gdbcontroller and variableswidget to reduce
the number of direct calls from gdbcontroller to methods of
variableswidget.
* gdbcontroller.h
gdbcontroller.cpp:
(GDBController::slotProduceBacktrace): New slot. Gets backtrace for
a thread via "thread apply XXX backtrace" and so doesn't change current
thread.
(GDBController::slotProduceVariablesInfo): New slot. Gets info about
parameters and local variables of a function.
(GDBController::parametersReady, GDBController::localsReady): New signals,
emitted whenever gdb parses the corresponding reply from gdb.
(GDBController::currentFrame): New signal, emitted after current frame might
have changed.
(GDBController::actOnProgramPause): Do not issue "info locals". Emit
'currentFrame'.
(GDBController::programNoApp): Don't invoke variablewidget method. Rely
instead on proper handling of the dbgStatus.
(GDBController::parseBacktraceList): Don't trim frames in variables view.
This will be done anyway on first currentFrame signal after program pause.
(GDBController::parseLocals): Just emit parametersReady and localsReady.
* variablewidget.h
variablewidget.cpp:
(VariableWidget::slotEvaluateExpression): New slot.
(VariableTree::setLocalViewState, setCurrentThread): Remove.
(VariableTree::produceVariablesInfo): New signal.
(VariableWidget::VariableWidget): Create new "Eval" button.
(VariableTree::slotDbgStatus): New slot. Trim everything when the
program no longer exists, and set a flag immediately after restart.
(VariableTree::slotCurrentFrame): New slot. Hide VarFrameRoot corresponding
to the previous frame, show the one corresponding to the selected one,
and populate it with variables if needed.
* framestackwidget.h
framestackwidget.cpp:
(FramestackWidget::produceBacktrace): New signal.
(FramestackWidget::getBacktrace): New method.
(ThreadStackItem::setOpen): Only fetch backtrace when there are no
children. Otherwise, when viewedThread_->setOpen(true) is called
after parsing backtrace we immediately emit another signal.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: new_vars_view.diff
Type: text/x-diff
Size: 28932 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20050614/b9b61e5f/attachment.bin>
More information about the KDevelop-devel
mailing list