From kde-commits Fri Oct 12 21:26:13 2007 From: Andras Mantia Date: Fri, 12 Oct 2007 21:26:13 +0000 To: kde-commits Subject: branches/KDE/3.5/kdewebdev/quanta Message-Id: <1192224373.789648.6884.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=119222438606688 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 @@ false - + quanta @@ -184,7 +184,7 @@ false - + true @@ -207,16 +207,17 @@ - + /usr/bin/gdb true false false true - - - + + + + false false @@ -259,10 +260,10 @@ - + Quanta speicfic header - + A new empty C++ file. @@ -300,7 +301,7 @@ - + set m_,_ theValue