[PATCH] Improved variables view
ghost at cs.msu.su
Tue Jun 14 18:27:34 UTC 2005
Attached is the patch that implements most of my suggestions for the variables
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
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
Comments are very welcome!
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.
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
4. Refactor communication between gdbcontroller and variableswidget to reduce
the number of direct calls from gdbcontroller to methods of
(GDBController::slotProduceBacktrace): New slot. Gets backtrace for
a thread via "thread apply XXX backtrace" and so doesn't change current
(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
(GDBController::actOnProgramPause): Do not issue "info locals". Emit
(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::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::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...
Size: 28932 bytes
Desc: not available
More information about the KDevelop-devel