[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdewebdev/quanta
From:       Andras Mantia <amantia () kde ! org>
Date:       2007-10-12 21:26:13
Message-ID: 1192224373.789648.6884.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 724631 by amantia:

Fix some crash issues when using the XDebug debugger.

 M  +4 -0      ChangeLog  
 M  +21 -6     components/debugger/dbgp/dbgpnetwork.cpp  
 M  +1 -0      components/debugger/dbgp/dbgpnetwork.h  
 M  +4 -0      components/debugger/dbgp/quantadebuggerdbgp.cpp  
 M  +10 -9     quanta.kdevelop  


--- branches/KDE/3.5/kdewebdev/quanta/ChangeLog #724630:724631
@@ -1,5 +1,9 @@
 This files contains the changes since Quanta 2.0 until the current 3.5.x series.
 
+Version 3.5.8+:
+ - bugfixes:
+      - fix crashes when using XDebug
+
 Version 3.5.8 (Release date: 07-10-2006)
  - bugfixes:
       - fix recursive symlink handling [#145651]
--- branches/KDE/3.5/kdewebdev/quanta/components/debugger/dbgp/dbgpnetwork.cpp \
#724630:724631 @@ -52,7 +52,7 @@
       connect(m_socket, SIGNAL(connected(const KResolverEntry &)), this, \
                SLOT(slotConnected(const KNetwork::KResolverEntry &)));
       connect(m_socket, SIGNAL(closed()), this, SLOT(slotConnectionClosed()));
       connect(m_socket, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
-
+      connect(m_socket, SIGNAL(destroyed()), this, SLOT(slotSocketDestroyed()));
       m_socket->connect();
       emit active(false);
       kdDebug(24002) << k_funcinfo << ", proxy:" << server << ", " << service << \
endl; @@ -66,6 +66,7 @@
 
       m_server->setAddressReuseable(true);
       connect(m_server, SIGNAL(readyAccept()), this, SLOT(slotReadyAccept()));
+      connect(m_server, SIGNAL(gotError(int)), this, SLOT(slotError(int)));
 
       if(m_server->listen())
       {
@@ -114,16 +115,16 @@
   kdDebug(24002) << k_funcinfo << ", m_server: " << m_server << ", m_socket" << \
m_socket << endl;  if(m_socket)
   {
+    kdDebug(24002) << k_funcinfo << ", " << m_socket->errorString() << endl;
     if(m_socket->error() == KNetwork::KSocketBase::RemotelyDisconnected)
     {
-//       slotConnectionClosed();
-//       emit networkError(i18n("Disconnected from remote host"), true);
+       slotConnectionClosed();
+       emit networkError(i18n("Disconnected from remote host"), true);
       return;
     }
 
     if(m_socket->error())
-    {
-      kdDebug(24002) << k_funcinfo << ", " << m_socket->errorString() << endl;
+    {      
       emit networkError(m_socket->errorString(), true);
     }
   }
@@ -147,8 +148,9 @@
     m_socket = (KNetwork::KStreamSocket *)m_server->accept(); // KSocketServer \
returns a KStreamSocket (!)  if(m_socket)
     {
-      kdDebug(24002) << k_funcinfo << ", ready" << endl;
+      kdDebug(24002) << k_funcinfo << ", ready" << ", m_socket" << m_socket << endl;
       m_socket->enableRead(true);
+      m_socket->setAddressReuseable(true);
 //       m_socket->setSocketFlags(KExtendedSocket::inetSocket |  \
KExtendedSocket::inputBufferedSocket);  //       m_socket->setBufferSize(-1);
       connect(m_socket, SIGNAL(gotError(int)), this, SLOT(slotError(int)));
@@ -203,6 +205,8 @@
 
   if(m_socket)
   {
+    m_socket->flush();
+    m_socket->close();
     delete m_socket;
     m_socket = NULL;
   }
@@ -216,6 +220,17 @@
 
 }
 
+
+//called when m_socket is destroyed either by deleting it or if XDebug disconnects \
from the client +void DBGpNetwork::slotSocketDestroyed()
+{
+  kdDebug(24002) << k_funcinfo << " , m_server: " << m_server << ", m_socket" << \
m_socket << endl; +
+  m_socket = NULL; //m_socket is already wrong, without this the app would crash on \
the next m_socket->close() or delete m_socket call. +  slotConnectionClosed();
+}
+
+
 // Data from socket
 void DBGpNetwork::slotReadyRead()
 {
--- branches/KDE/3.5/kdewebdev/quanta/components/debugger/dbgp/dbgpnetwork.h \
#724630:724631 @@ -69,6 +69,7 @@
     void slotError(int);
     void slotReadyRead();
     void slotReadyAccept();
+    void slotSocketDestroyed();
 };
 
 
--- branches/KDE/3.5/kdewebdev/quanta/components/debugger/dbgp/quantadebuggerdbgp.cpp \
#724630:724631 @@ -200,11 +200,13 @@
   {
     setExecutionState(Stopping);
     emit updateStatus(DebuggerUI::Paused);
+    m_network.slotSocketDestroyed(); //XDebug disconnects when stopped and destroys \
our socket  }
   else if(state == "stopped")
   {
     setExecutionState(Stopped);
     emit updateStatus(DebuggerUI::Paused);
+    m_network.slotSocketDestroyed(); //XDebug disconnects when stopped and destroys \
our socket  }
   else if(state == "running")
   {
@@ -307,6 +309,8 @@
     
     else if(command == "property_set")
       propertySetResponse(response);
+    else if(command == "stop")
+      setExecutionState("stopped");
 
     // Unknown command...
     else
--- branches/KDE/3.5/kdewebdev/quanta/quanta.kdevelop #724630:724631
@@ -18,7 +18,7 @@
     <absoluteprojectpath>false</absoluteprojectpath>
     <secondaryLanguages/>
     <versioncontrol/>
-    <defaultencoding/>
+    <defaultencoding></defaultencoding>
     <projectname>quanta</projectname>
   </general>
   <kdevautoproject>
@@ -184,7 +184,7 @@
     </groups>
     <tree>
       <hidenonprojectfiles>false</hidenonprojectfiles>
-      <hidepatterns></hidepatterns>
+      <hidepatterns/>
       <showvcsfields>true</showvcsfields>
     </tree>
   </kdevfileview>
@@ -207,16 +207,17 @@
   </kdevdoctreeview>
   <kdevdebugger>
     <general>
-      <dbgshell/>
+      <dbgshell></dbgshell>
       <programargs/>
       <gdbpath>/usr/bin/gdb</gdbpath>
       <breakonloadinglibs>true</breakonloadinglibs>
       <separatetty>false</separatetty>
       <floatingtoolbar>false</floatingtoolbar>
       <runappinappdirectory>true</runappinappdirectory>
-      <configGdbScript/>
-      <runShellScript/>
-      <runGdbScript/>
+      <configGdbScript></configGdbScript>
+      <runShellScript></runShellScript>
+      <runGdbScript></runGdbScript>
+      <raiseGDBOnStart>false</raiseGDBOnStart>
     </general>
     <display>
       <staticmembers>false</staticmembers>
@@ -259,10 +260,10 @@
   </kdevcvs>
   <kdevfilecreate>
     <filetypes>
-      <type icon="" ext="h" name="C++ header" create="template" >
+      <type icon="" ext="h" create="template" name="C++ header" >
         <descr>Quanta speicfic header</descr>
       </type>
-      <type icon="source_cpp" ext="cpp" name="C++ source" create="template" >
+      <type icon="source_cpp" ext="cpp" create="template" name="C++ source" >
         <descr>A new empty C++ file.</descr>
       </type>
     </filetypes>
@@ -300,7 +301,7 @@
     </codecompletion>
     <references/>
     <creategettersetter>
-      <prefixGet/>
+      <prefixGet></prefixGet>
       <prefixSet>set</prefixSet>
       <prefixVariable>m_,_</prefixVariable>
       <parameterName>theValue</parameterName>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic