branches/kdevelop/3.4/languages/cpp/debugger

Robert Gruber rgruber at users.sourceforge.net
Sun Jan 15 13:05:06 UTC 2006


SVN commit 498306 by rgruber:

Removed s_viewLocals state from gdb debugger as discussed on mailinglist
a few weeks ago.
The decision whether to request locals and params is now done by the
VariableTree and no longer by the controller.
CCMAIL:kdevelop-devel at kdevelop.org


 M  +1 -2      dbgcontroller.h  
 M  +0 -2      debuggerpart.cpp  
 M  +8 -30     gdbcontroller.cpp  
 M  +0 -1      gdbcontroller.h  
 M  +13 -15    variablewidget.cpp  
 M  +0 -1      variablewidget.h  


--- branches/kdevelop/3.4/languages/cpp/debugger/dbgcontroller.h #498305:498306
@@ -48,7 +48,7 @@
   s_waitForWrite      = 8,
   s_programExited     = 16,
   s_silent            = 32,
-  s_viewLocals        = 64,
+//  removed s_viewLocals        = 64,
   s_viewBT            = 128,
   s_viewBP            = 256,
   s_attached          = 512,
@@ -121,7 +121,6 @@
     virtual void slotExpandUserItem(ValueCallback* callback,
                                     const QString &expression)             = 0;
     virtual void slotSelectFrame(int frame, int thread, bool needFrames)    = 0;
-    virtual void slotSetLocalViewState(bool onOff)                          = 0;
 
     // jw - for optional additional commands and initialization
     virtual void slotVarItemConstructed(VarItem */*item*/) {}
--- branches/kdevelop/3.4/languages/cpp/debugger/debuggerpart.cpp #498305:498306
@@ -554,8 +554,6 @@
              controller,            SLOT(slotExpandItem(TrimmableItem*)));
     connect( variableTree,          SIGNAL(expandUserItem(ValueCallback*, const QString&)),
              controller,            SLOT(slotExpandUserItem(ValueCallback*, const QString&)));
-    connect( variableTree,          SIGNAL(setLocalViewState(bool)),
-             controller,            SLOT(slotSetLocalViewState(bool)));
     connect( variableTree,          SIGNAL(varItemConstructed(VarItem*)),
              controller,            SLOT(slotVarItemConstructed(VarItem*)));     // jw
     connect( variableTree,          SIGNAL(produceVariablesInfo()),
--- branches/kdevelop/3.4/languages/cpp/debugger/gdbcontroller.cpp #498305:498306
@@ -429,7 +429,7 @@
 // all other commands are disabled.
 void GDBController::programNoApp(const QString &msg, bool msgBox)
 {
-    state_ = (s_appNotStarted|s_programExited|(state_&(s_viewLocals|s_shuttingDown)));
+    state_ = (s_appNotStarted|s_programExited|s_shuttingDown);
     destroyCmds();
 
     // We're always at frame zero when the program stops
@@ -1588,11 +1588,8 @@
     // command
     queueCmd(new GDBCommand("backtrace", NOTRUNCMD, INFOCMD, BACKTRACE));
 
-    if (stateIsOn(s_viewLocals))
-    {
-        queueCmd(new GDBCommand("info args", NOTRUNCMD, INFOCMD, ARGS));
-        queueCmd(new GDBCommand("info local", NOTRUNCMD, INFOCMD, LOCALS));
-    }
+    queueCmd(new GDBCommand("info args", NOTRUNCMD, INFOCMD, ARGS));
+    queueCmd(new GDBCommand("info local", NOTRUNCMD, INFOCMD, LOCALS));
 }
 
 // **************************************************************************
@@ -1610,11 +1607,8 @@
     // command
     queueCmd(new GDBCommand("backtrace", NOTRUNCMD, INFOCMD, BACKTRACE));
 
-    if (stateIsOn(s_viewLocals))
-    {
-        queueCmd(new GDBCommand("info args", NOTRUNCMD, INFOCMD, ARGS));
-        queueCmd(new GDBCommand("info local", NOTRUNCMD, INFOCMD, LOCALS));
-    }
+    queueCmd(new GDBCommand("info args", NOTRUNCMD, INFOCMD, ARGS));
+    queueCmd(new GDBCommand("info local", NOTRUNCMD, INFOCMD, LOCALS));
 }
 
 // **************************************************************************
@@ -1973,10 +1967,8 @@
 
 void GDBController::slotProduceVariablesInfo()
 {
-    if (stateIsOn(s_viewLocals)) {
-        queueCmd(new GDBCommand("info args", NOTRUNCMD, INFOCMD, ARGS));
-        queueCmd(new GDBCommand("info local", NOTRUNCMD, INFOCMD, LOCALS));    
-    } 
+    queueCmd(new GDBCommand("info args", NOTRUNCMD, INFOCMD, ARGS));
+    queueCmd(new GDBCommand("info local", NOTRUNCMD, INFOCMD, LOCALS));    
 }
 
 // **************************************************************************
@@ -2090,20 +2082,6 @@
 
 // **************************************************************************
 
-// The user will only get locals if one of the branches to the local tree
-// is open. This speeds up stepping through code a great deal.
-void GDBController::slotSetLocalViewState(bool onOff)
-{
-    if (onOff)
-        setStateOn(s_viewLocals);
-    else
-        setStateOff(s_viewLocals);
-
-    kdDebug(9012) << (onOff ? "<Locals ON>": "<Locals OFF>") << endl;
-}
-
-// **************************************************************************
-
 // Data from gdb gets processed here.
 void GDBController::slotDbgStdout(KProcess *, char *buf, int buflen)
 {
@@ -2205,7 +2183,7 @@
         emit debuggerAbnormalExit();
 
     destroyCmds();
-    state_ = s_dbgNotStarted|s_appNotStarted|s_programExited|(state_&(s_viewLocals|s_shuttingDown));
+    state_ = (s_dbgNotStarted|s_appNotStarted|s_programExited|s_shuttingDown);
     emit dbgStatus (i18n("Process exited"), state_);
 
     emit gdbStdout("(gdb) Process exited\n");
--- branches/kdevelop/3.4/languages/cpp/debugger/gdbcontroller.h #498305:498306
@@ -121,7 +121,6 @@
     void slotExpandUserItem(ValueCallback* callback, 
                             const QString &expression);
     void slotSelectFrame(int frameNo, int threadNo, bool needFrames);
-    void slotSetLocalViewState(bool onOff);
     void slotProduceBacktrace(int threadNo);
     /** Produces information about local variables of the current frame
         by means of emitting localsReady and parametersReady signals. */
--- branches/kdevelop/3.4/languages/cpp/debugger/variablewidget.cpp #498305:498306
@@ -625,10 +625,13 @@
     // will be repopulated if needed.
     if (frame->needLocals() || justPaused_) 
     {
-        setActiveFlag();
-        // This will eventually call back to slotParametersReady and 
-        // slotLocalsReady
-        emit produceVariablesInfo();
+        if (frame->isOpen())
+        {
+            setActiveFlag();
+          // This will eventually call back to slotParametersReady and 
+          // slotLocalsReady
+            emit produceVariablesInfo();
+        }
 
         if (justPaused_)
         {
@@ -1201,23 +1204,18 @@
 // state. This
 void VarFrameRoot::setOpen(bool open)
 {
-    bool stateChanged = ( isOpen() != open );
+    bool frameOpened = ( isOpen()==false && open==true );
     QListViewItem::setOpen(open);
 
     VariableTree *parent = (VariableTree*)listView();
-    if (parent && stateChanged) {
-        //everytime the open-state changed we need to tell the controller
-        emit parent->setLocalViewState(open);
+    if (parent && frameOpened) {
+        parent->setActiveFlag();
+        emit parent->produceVariablesInfo();
     }
-
+/*
     if (!open)
         return;
-
-    if (parent && stateChanged) {
-        //if the open-state changed to OPEN we need to reget the locals 
-        emit parent->produceVariablesInfo();
-    }
-
+*/
     if (!params_.isNull())
         GDBParser::getGDBParser()->parseCompositeValue(this, params_.data());
     if (!locals_.isNull())
--- branches/kdevelop/3.4/languages/cpp/debugger/variablewidget.h #498305:498306
@@ -105,7 +105,6 @@
     void toggleWatchpoint(const QString &varName);
     void expandItem(TrimmableItem *item);
     void expandUserItem(ValueCallback* callback, const QString &request);
-    void setLocalViewState(bool localsOn);
     // Emitted when *this is interested in args and locals for the
     // current frame.
     void produceVariablesInfo();




More information about the KDevelop-devel mailing list