Commit 63587ff7 authored by hjk's avatar hjk

debugger: clear more status variables in initializeVariables() to

prevent inter-session dependencies

cherry-picked from master

Conflicts:

	src/plugins/debugger/gdb/gdbengine.cpp
parent f2042b8b
......@@ -113,13 +113,13 @@ static const QString tooltipIName = _("tooltip");
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());
......@@ -200,6 +200,26 @@ void GdbEngine::initializeVariables()
m_autoContinue = false;
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)
......@@ -3523,7 +3543,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();
......
......@@ -241,7 +241,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
......
......@@ -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())
......
......@@ -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;
......
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