diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 88c93a08e540c2072ed9236a26614abe2a9c93e4..9bd7cd873351fc58008773f0560dd1259846fd2f 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -111,13 +111,13 @@ static int ¤tToken() GdbEngine::GdbEngine(DebuggerManager *parent) : #ifdef Q_OS_WIN // Do injection loading with MinGW (call loading does not work with 64bit) - m_dumperInjectionLoad(true) + m_dumperInjectionLoad(true), #else - m_dumperInjectionLoad(false) + m_dumperInjectionLoad(false), #endif + q(parent), + qq(parent->engineInterface()) { - q = parent; - qq = parent->engineInterface(); m_stubProc.setMode(Core::Utils::ConsoleProcess::Debug); #ifdef Q_OS_UNIX m_stubProc.setSettings(Core::ICore::instance()->settings()); @@ -199,6 +199,25 @@ void GdbEngine::initializeVariables() m_waitingForFirstBreakpointToBeHit = false; m_commandsToRunOnTemporaryBreak.clear(); m_cookieForToken.clear(); + m_customOutputForToken.clear(); + + m_pendingConsoleStreamOutput.clear(); + m_pendingTargetStreamOutput.clear(); + m_pendingLogStreamOutput.clear(); + + m_inbuffer.clear(); + + m_address.clear(); + m_currentFunctionArgs.clear(); + m_currentFrame.clear(); + m_dumperHelper = QtDumperHelper(); + + // FIXME: unhandled: + //m_outputCodecState = QTextCodec::ConverterState(); + //OutputCollector m_outputCollector; + //QProcess m_gdbProc; + //QProcess m_uploadProc; + //Core::Utils::ConsoleProcess m_stubProc; } void GdbEngine::gdbProcError(QProcess::ProcessError error) @@ -3458,7 +3477,8 @@ void GdbEngine::handleDebuggingHelperValue3(const GdbResultRecord &record, void GdbEngine::updateLocals() { // Asynchronous load of injected library, initialize in first stop - if (m_dumperInjectionLoad && m_debuggingHelperState == DebuggingHelperLoadTried && m_dumperHelper.typeCount() == 0 + if (m_dumperInjectionLoad && m_debuggingHelperState == DebuggingHelperLoadTried + && m_dumperHelper.typeCount() == 0 && q->inferiorPid() > 0) tryQueryDebuggingHelpers(); diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 552ae564447260a8f7271e9b283497a0e5897740..47dbd655cfd8676a66c618be15c4a760bb3e36b9 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -242,7 +242,6 @@ private: QByteArray m_pendingConsoleStreamOutput; QByteArray m_pendingTargetStreamOutput; QByteArray m_pendingLogStreamOutput; - //QString m_pwd; // contains the first token number for the current round // of evaluation. Responses with older tokens are considers @@ -364,7 +363,6 @@ private: bool startModeAllowsDumpers() const; - QString m_editedData; int m_pendingRequests; QtDumperHelper m_dumperHelper; @@ -380,8 +378,9 @@ private: QList<GdbCommand> m_commandsToRunOnTemporaryBreak; - DebuggerManager *q; - IDebuggerManagerAccessForEngines *qq; + DebuggerManager * const q; + IDebuggerManagerAccessForEngines * const qq; + // make sure to re-initialize new members in initializeVariables(); }; } // namespace Internal diff --git a/src/plugins/debugger/watchutils.cpp b/src/plugins/debugger/watchutils.cpp index 99490ba547c3999c503a69315cb783384f2266c9..883d6cba1f736c976f89a42229939476fa35ebbe 100644 --- a/src/plugins/debugger/watchutils.cpp +++ b/src/plugins/debugger/watchutils.cpp @@ -557,8 +557,9 @@ void QtDumperHelper::TypeData::clear() } // ----------------- QtDumperHelper +const QString stdAllocatorPrefix = QLatin1String("std::allocator"); + QtDumperHelper::QtDumperHelper() : - m_stdAllocatorPrefix(QLatin1String("std::allocator")), m_intSize(0), m_pointerSize(0), m_stdAllocatorSize(0), @@ -1053,7 +1054,7 @@ void QtDumperHelper::addSize(const QString &name, int size) m_intSize = size; break; } - if (name.startsWith(m_stdAllocatorPrefix)) { + if (name.startsWith(stdAllocatorPrefix)) { m_stdAllocatorSize = size; break; } @@ -1103,7 +1104,7 @@ QString QtDumperHelper::evaluationSizeofTypeExpression(const QString &typeName, // Look up fixed types if (m_pointerSize && isPointerType(typeName)) return QString::number(m_pointerSize); - if (m_stdAllocatorSize && typeName.startsWith(m_stdAllocatorPrefix)) + if (m_stdAllocatorSize && typeName.startsWith(stdAllocatorPrefix)) return QString::number(m_stdAllocatorSize); const SizeCache::const_iterator sit = m_sizeCache.constFind(typeName); if (sit != m_sizeCache.constEnd()) diff --git a/src/plugins/debugger/watchutils.h b/src/plugins/debugger/watchutils.h index 6385354a8995e8078c8e7505175e65f4a4e5357a..52339fb0bfd3db2af595382df287f44e740ce304 100644 --- a/src/plugins/debugger/watchutils.h +++ b/src/plugins/debugger/watchutils.h @@ -212,8 +212,6 @@ private: static Type specialType(QString s); QString evaluationSizeofTypeExpression(const QString &typeName, Debugger d) const; - const QString m_stdAllocatorPrefix; - NameTypeMap m_nameTypeMap; SizeCache m_sizeCache; int m_intSize;