Bug 68015: Variables/Watch Window closes on first view

Vladimir Prus ghost at cs.msu.su
Wed May 18 09:08:03 UTC 2005

I'm just run into http://bugs.kde.org/show_bug.cgi?id=68015 and is trying
to fix this. However, I need some help.

To recap, the "variables" window is a tree view. The items corresponding to
frames have items corresponding to variables as children. The the window
is opened the first time, items corresponding to frames are closed, and to
view variables I need to open those items. However, when I click at the "+" 
symbol, the window immediately disappears and to actually see the variables
I need to open the window again.

The sequences of events that lead to that is:

1. The VariableTree::setLocalViewState is invoked and emits
   'selectFrame' signal.

2. The singal is connected to FramestackWidget::slotSelectFrame, which
   emits 'selectFrame' signal.

3. That signal is connected to GDBController::slotSelectFrame, which contains
   this code:

   queueCmd(new GDBCommand(QCString().sprintf("frame %d",
                                frameNo), NOTRUNCMD, INFOCMD, FRAME));

4. When GDBController reads reply from gdb, it emits showStepInSource signal.

5. That signal arrives to DebuggerPart::slotShowStep, that contains this:

    debugger()->gotoExecutionPoint(KURL( fileName ), lineNum-1);

and 'Debugger::gotoExecutionPoint' has

    m_partController->editDocument(url, lineNum);

6. editDocument gets the KPart for the file, then gets widget for the part and
finally PartController::activatePart does


and KMDI hides the variables window.

The attached patch fixes the problem for the case where you want to look
at variables in the current thread, but still does not work when looking at
vars in the other thread.

It's certainly needed to switch frame to get information about variables,
but then it's needed to prevent emitting slotShowStep. And in fact, currently
after showning the list of variables for a thread/frame, debugger switches to
that thread/frame. This behaviour does not seem intuitive, maybe it's better 
1. Disable 'slotShowStep'.
2. Switch to needed frame
3. Get local vars.
4. Swithc back to current frame
5. Enable 'slotShowStep'


Thanks in advance,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdbcontroller.diff
Type: text/x-diff
Size: 1243 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20050518/4e47c470/attachment.bin>

More information about the KDevelop-devel mailing list