Commit 3d9c65f2 authored by hjk's avatar hjk
Browse files

debugger: clear more status variables in initializeVariables() to

prevent inter-session dependencies
parent 8f2d0094
...@@ -111,13 +111,13 @@ static int &currentToken() ...@@ -111,13 +111,13 @@ static int &currentToken()
GdbEngine::GdbEngine(DebuggerManager *parent) : GdbEngine::GdbEngine(DebuggerManager *parent) :
#ifdef Q_OS_WIN // Do injection loading with MinGW (call loading does not work with 64bit) #ifdef Q_OS_WIN // Do injection loading with MinGW (call loading does not work with 64bit)
m_dumperInjectionLoad(true) m_dumperInjectionLoad(true),
#else #else
m_dumperInjectionLoad(false) m_dumperInjectionLoad(false),
#endif #endif
q(parent),
qq(parent->engineInterface())
{ {
q = parent;
qq = parent->engineInterface();
m_stubProc.setMode(Core::Utils::ConsoleProcess::Debug); m_stubProc.setMode(Core::Utils::ConsoleProcess::Debug);
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
m_stubProc.setSettings(Core::ICore::instance()->settings()); m_stubProc.setSettings(Core::ICore::instance()->settings());
...@@ -199,6 +199,25 @@ void GdbEngine::initializeVariables() ...@@ -199,6 +199,25 @@ void GdbEngine::initializeVariables()
m_waitingForFirstBreakpointToBeHit = false; m_waitingForFirstBreakpointToBeHit = false;
m_commandsToRunOnTemporaryBreak.clear(); m_commandsToRunOnTemporaryBreak.clear();
m_cookieForToken.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) void GdbEngine::gdbProcError(QProcess::ProcessError error)
...@@ -3458,7 +3477,8 @@ void GdbEngine::handleDebuggingHelperValue3(const GdbResultRecord &record, ...@@ -3458,7 +3477,8 @@ void GdbEngine::handleDebuggingHelperValue3(const GdbResultRecord &record,
void GdbEngine::updateLocals() void GdbEngine::updateLocals()
{ {
// Asynchronous load of injected library, initialize in first stop // 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) && q->inferiorPid() > 0)
tryQueryDebuggingHelpers(); tryQueryDebuggingHelpers();
......
...@@ -242,7 +242,6 @@ private: ...@@ -242,7 +242,6 @@ private:
QByteArray m_pendingConsoleStreamOutput; QByteArray m_pendingConsoleStreamOutput;
QByteArray m_pendingTargetStreamOutput; QByteArray m_pendingTargetStreamOutput;
QByteArray m_pendingLogStreamOutput; QByteArray m_pendingLogStreamOutput;
//QString m_pwd;
// contains the first token number for the current round // contains the first token number for the current round
// of evaluation. Responses with older tokens are considers // of evaluation. Responses with older tokens are considers
...@@ -364,7 +363,6 @@ private: ...@@ -364,7 +363,6 @@ private:
bool startModeAllowsDumpers() const; bool startModeAllowsDumpers() const;
QString m_editedData;
int m_pendingRequests; int m_pendingRequests;
QtDumperHelper m_dumperHelper; QtDumperHelper m_dumperHelper;
...@@ -380,8 +378,9 @@ private: ...@@ -380,8 +378,9 @@ private:
QList<GdbCommand> m_commandsToRunOnTemporaryBreak; QList<GdbCommand> m_commandsToRunOnTemporaryBreak;
DebuggerManager *q; DebuggerManager * const q;
IDebuggerManagerAccessForEngines *qq; IDebuggerManagerAccessForEngines * const qq;
// make sure to re-initialize new members in initializeVariables();
}; };
} // namespace Internal } // namespace Internal
......
...@@ -557,8 +557,9 @@ void QtDumperHelper::TypeData::clear() ...@@ -557,8 +557,9 @@ void QtDumperHelper::TypeData::clear()
} }
// ----------------- QtDumperHelper // ----------------- QtDumperHelper
const QString stdAllocatorPrefix = QLatin1String("std::allocator");
QtDumperHelper::QtDumperHelper() : QtDumperHelper::QtDumperHelper() :
m_stdAllocatorPrefix(QLatin1String("std::allocator")),
m_intSize(0), m_intSize(0),
m_pointerSize(0), m_pointerSize(0),
m_stdAllocatorSize(0), m_stdAllocatorSize(0),
...@@ -1053,7 +1054,7 @@ void QtDumperHelper::addSize(const QString &name, int size) ...@@ -1053,7 +1054,7 @@ void QtDumperHelper::addSize(const QString &name, int size)
m_intSize = size; m_intSize = size;
break; break;
} }
if (name.startsWith(m_stdAllocatorPrefix)) { if (name.startsWith(stdAllocatorPrefix)) {
m_stdAllocatorSize = size; m_stdAllocatorSize = size;
break; break;
} }
...@@ -1103,7 +1104,7 @@ QString QtDumperHelper::evaluationSizeofTypeExpression(const QString &typeName, ...@@ -1103,7 +1104,7 @@ QString QtDumperHelper::evaluationSizeofTypeExpression(const QString &typeName,
// Look up fixed types // Look up fixed types
if (m_pointerSize && isPointerType(typeName)) if (m_pointerSize && isPointerType(typeName))
return QString::number(m_pointerSize); return QString::number(m_pointerSize);
if (m_stdAllocatorSize && typeName.startsWith(m_stdAllocatorPrefix)) if (m_stdAllocatorSize && typeName.startsWith(stdAllocatorPrefix))
return QString::number(m_stdAllocatorSize); return QString::number(m_stdAllocatorSize);
const SizeCache::const_iterator sit = m_sizeCache.constFind(typeName); const SizeCache::const_iterator sit = m_sizeCache.constFind(typeName);
if (sit != m_sizeCache.constEnd()) if (sit != m_sizeCache.constEnd())
......
...@@ -212,8 +212,6 @@ private: ...@@ -212,8 +212,6 @@ private:
static Type specialType(QString s); static Type specialType(QString s);
QString evaluationSizeofTypeExpression(const QString &typeName, Debugger d) const; QString evaluationSizeofTypeExpression(const QString &typeName, Debugger d) const;
const QString m_stdAllocatorPrefix;
NameTypeMap m_nameTypeMap; NameTypeMap m_nameTypeMap;
SizeCache m_sizeCache; SizeCache m_sizeCache;
int m_intSize; int m_intSize;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment