forked from qt-creator/qt-creator
cdb plugin: make the fast dumper initialization an option
Fast dumper init is now on by default. Reviewed-by: Robert Loehning
This commit is contained in:
@@ -391,6 +391,7 @@ void CdbDebugEngine::startDebugger(const QSharedPointer<DebuggerStartParameters>
|
|||||||
dumperEnabled = false;
|
dumperEnabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_d->m_dumper->setFastSymbolResolution(m_d->m_options->fastLoadDebuggingHelpers);
|
||||||
m_d->m_dumper->reset(dumperLibName, dumperEnabled);
|
m_d->m_dumper->reset(dumperLibName, dumperEnabled);
|
||||||
|
|
||||||
setState(InferiorStarting, Q_FUNC_INFO, __LINE__);
|
setState(InferiorStarting, Q_FUNC_INFO, __LINE__);
|
||||||
|
@@ -307,7 +307,8 @@ CdbDumperHelper::CdbDumperHelper(DebuggerManager *manager,
|
|||||||
m_outBufferSize(0),
|
m_outBufferSize(0),
|
||||||
m_buffer(0),
|
m_buffer(0),
|
||||||
m_dumperCallThread(0),
|
m_dumperCallThread(0),
|
||||||
m_goCommand(goCommand(m_dumperCallThread))
|
m_goCommand(goCommand(m_dumperCallThread)),
|
||||||
|
m_fastSymbolResolution(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -439,25 +440,25 @@ bool CdbDumperHelper::initResolveSymbols(QString *errorMessage)
|
|||||||
// There is a 'qDumpInBuffer' in QtCore as well.
|
// There is a 'qDumpInBuffer' in QtCore as well.
|
||||||
if (loadDebug)
|
if (loadDebug)
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
#if 1
|
|
||||||
// Symbols in the debugging helpers are never namespaced.
|
|
||||||
// Keeping the old code for now. ### maybe use as fallback?
|
|
||||||
const QString dumperModuleName = QLatin1String(dumperModuleNameC);
|
|
||||||
m_dumpObjectSymbol = dumperModuleName + QLatin1String("!qDumpObjectData440");
|
|
||||||
QString inBufferSymbol = dumperModuleName + QLatin1String("!qDumpInBuffer");
|
|
||||||
QString outBufferSymbol = dumperModuleName + QLatin1String("!qDumpOutBuffer");
|
|
||||||
bool rc;
|
bool rc;
|
||||||
#else
|
|
||||||
m_dumpObjectSymbol = QLatin1String("*qDumpObjectData440");
|
|
||||||
QString inBufferSymbol = QLatin1String("*qDumpInBuffer");
|
|
||||||
QString outBufferSymbol = QLatin1String("*qDumpOutBuffer");
|
|
||||||
const QString dumperModuleName = QLatin1String(dumperModuleNameC);
|
const QString dumperModuleName = QLatin1String(dumperModuleNameC);
|
||||||
bool rc = resolveSymbol(m_coreEngine->interfaces().debugSymbols, &m_dumpObjectSymbol, errorMessage) == ResolveSymbolOk
|
QString inBufferSymbol, outBufferSymbol;
|
||||||
&& resolveSymbol(m_coreEngine->interfaces().debugSymbols, dumperModuleName, &inBufferSymbol, errorMessage) == ResolveSymbolOk
|
if (m_fastSymbolResolution) {
|
||||||
&& resolveSymbol(m_coreEngine->interfaces().debugSymbols, dumperModuleName, &outBufferSymbol, errorMessage) == ResolveSymbolOk;
|
// Symbols in the debugging helpers are never namespaced.
|
||||||
if (!rc)
|
m_dumpObjectSymbol = dumperModuleName + QLatin1String("!qDumpObjectData440");
|
||||||
return false;
|
inBufferSymbol = dumperModuleName + QLatin1String("!qDumpInBuffer");
|
||||||
#endif
|
outBufferSymbol = dumperModuleName + QLatin1String("!qDumpOutBuffer");
|
||||||
|
} else {
|
||||||
|
// Classical approach of loading the dumper symbols. Takes some time though.
|
||||||
|
m_dumpObjectSymbol = QLatin1String("*qDumpObjectData440");
|
||||||
|
inBufferSymbol = QLatin1String("*qDumpInBuffer");
|
||||||
|
outBufferSymbol = QLatin1String("*qDumpOutBuffer");
|
||||||
|
bool rc = resolveSymbol(m_coreEngine->interfaces().debugSymbols, &m_dumpObjectSymbol, errorMessage) == ResolveSymbolOk
|
||||||
|
&& resolveSymbol(m_coreEngine->interfaces().debugSymbols, dumperModuleName, &inBufferSymbol, errorMessage) == ResolveSymbolOk
|
||||||
|
&& resolveSymbol(m_coreEngine->interfaces().debugSymbols, dumperModuleName, &outBufferSymbol, errorMessage) == ResolveSymbolOk;
|
||||||
|
if (!rc)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// Determine buffer addresses, sizes and alloc buffer
|
// Determine buffer addresses, sizes and alloc buffer
|
||||||
rc = getSymbolAddress(m_coreEngine->interfaces().debugSymbols, inBufferSymbol, &m_inBufferAddress, &m_inBufferSize, errorMessage)
|
rc = getSymbolAddress(m_coreEngine->interfaces().debugSymbols, inBufferSymbol, &m_inBufferAddress, &m_inBufferSize, errorMessage)
|
||||||
&& getSymbolAddress(m_coreEngine->interfaces().debugSymbols, outBufferSymbol, &m_outBufferAddress, &m_outBufferSize, errorMessage);
|
&& getSymbolAddress(m_coreEngine->interfaces().debugSymbols, outBufferSymbol, &m_outBufferAddress, &m_outBufferSize, errorMessage);
|
||||||
|
@@ -92,6 +92,8 @@ public:
|
|||||||
State state() const { return m_state; }
|
State state() const { return m_state; }
|
||||||
bool isEnabled() const { return m_state != Disabled; }
|
bool isEnabled() const { return m_state != Disabled; }
|
||||||
|
|
||||||
|
void setFastSymbolResolution(bool b) { m_fastSymbolResolution = b; }
|
||||||
|
|
||||||
// Disable in case of a debuggee crash.
|
// Disable in case of a debuggee crash.
|
||||||
void disable();
|
void disable();
|
||||||
|
|
||||||
@@ -156,6 +158,7 @@ private:
|
|||||||
QtDumperHelper m_helper;
|
QtDumperHelper m_helper;
|
||||||
unsigned long m_dumperCallThread;
|
unsigned long m_dumperCallThread;
|
||||||
QString m_goCommand;
|
QString m_goCommand;
|
||||||
|
bool m_fastSymbolResolution;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -40,13 +40,15 @@ static const char *pathKeyC = "Path";
|
|||||||
static const char *symbolPathsKeyC = "SymbolPaths";
|
static const char *symbolPathsKeyC = "SymbolPaths";
|
||||||
static const char *sourcePathsKeyC = "SourcePaths";
|
static const char *sourcePathsKeyC = "SourcePaths";
|
||||||
static const char *verboseSymbolLoadingKeyC = "VerboseSymbolLoading";
|
static const char *verboseSymbolLoadingKeyC = "VerboseSymbolLoading";
|
||||||
|
static const char *fastLoadDebuggingHelpersKeyC = "FastLoadDebuggingHelpers";
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
CdbOptions::CdbOptions() :
|
CdbOptions::CdbOptions() :
|
||||||
enabled(false),
|
enabled(false),
|
||||||
verboseSymbolLoading(false)
|
verboseSymbolLoading(false),
|
||||||
|
fastLoadDebuggingHelpers(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,6 +56,7 @@ void CdbOptions::clear()
|
|||||||
{
|
{
|
||||||
enabled = false;
|
enabled = false;
|
||||||
verboseSymbolLoading = false;
|
verboseSymbolLoading = false;
|
||||||
|
fastLoadDebuggingHelpers = true;
|
||||||
path.clear();
|
path.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,6 +77,7 @@ void CdbOptions::fromSettings(const QSettings *s)
|
|||||||
symbolPaths = s->value(keyRoot + QLatin1String(symbolPathsKeyC), QStringList()).toStringList();
|
symbolPaths = s->value(keyRoot + QLatin1String(symbolPathsKeyC), QStringList()).toStringList();
|
||||||
sourcePaths = s->value(keyRoot + QLatin1String(sourcePathsKeyC), QStringList()).toStringList();
|
sourcePaths = s->value(keyRoot + QLatin1String(sourcePathsKeyC), QStringList()).toStringList();
|
||||||
verboseSymbolLoading = s->value(keyRoot + QLatin1String(verboseSymbolLoadingKeyC), false).toBool();
|
verboseSymbolLoading = s->value(keyRoot + QLatin1String(verboseSymbolLoadingKeyC), false).toBool();
|
||||||
|
fastLoadDebuggingHelpers = s->value(keyRoot + QLatin1String(fastLoadDebuggingHelpersKeyC), true).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CdbOptions::toSettings(QSettings *s) const
|
void CdbOptions::toSettings(QSettings *s) const
|
||||||
@@ -84,6 +88,7 @@ void CdbOptions::toSettings(QSettings *s) const
|
|||||||
s->setValue(QLatin1String(symbolPathsKeyC), symbolPaths);
|
s->setValue(QLatin1String(symbolPathsKeyC), symbolPaths);
|
||||||
s->setValue(QLatin1String(sourcePathsKeyC), sourcePaths);
|
s->setValue(QLatin1String(sourcePathsKeyC), sourcePaths);
|
||||||
s->setValue(QLatin1String(verboseSymbolLoadingKeyC), verboseSymbolLoading);
|
s->setValue(QLatin1String(verboseSymbolLoadingKeyC), verboseSymbolLoading);
|
||||||
|
s->setValue(QLatin1String(fastLoadDebuggingHelpersKeyC), fastLoadDebuggingHelpers);
|
||||||
s->endGroup();
|
s->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,6 +101,8 @@ unsigned CdbOptions::compare(const CdbOptions &rhs) const
|
|||||||
rc |= DebuggerPathsChanged;
|
rc |= DebuggerPathsChanged;
|
||||||
if (verboseSymbolLoading != rhs.verboseSymbolLoading)
|
if (verboseSymbolLoading != rhs.verboseSymbolLoading)
|
||||||
rc |= SymbolOptionsChanged;
|
rc |= SymbolOptionsChanged;
|
||||||
|
if (fastLoadDebuggingHelpers != rhs.fastLoadDebuggingHelpers)
|
||||||
|
rc |= FastLoadDebuggingHelpersChanged;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -51,7 +51,8 @@ public:
|
|||||||
// A set of flags for comparison function.
|
// A set of flags for comparison function.
|
||||||
enum ChangeFlags { InitializationOptionsChanged = 0x1,
|
enum ChangeFlags { InitializationOptionsChanged = 0x1,
|
||||||
DebuggerPathsChanged = 0x2,
|
DebuggerPathsChanged = 0x2,
|
||||||
SymbolOptionsChanged = 0x4 };
|
SymbolOptionsChanged = 0x4,
|
||||||
|
FastLoadDebuggingHelpersChanged = 0x8 };
|
||||||
unsigned compare(const CdbOptions &s) const;
|
unsigned compare(const CdbOptions &s) const;
|
||||||
|
|
||||||
bool enabled;
|
bool enabled;
|
||||||
@@ -59,6 +60,7 @@ public:
|
|||||||
QStringList symbolPaths;
|
QStringList symbolPaths;
|
||||||
QStringList sourcePaths;
|
QStringList sourcePaths;
|
||||||
bool verboseSymbolLoading;
|
bool verboseSymbolLoading;
|
||||||
|
bool fastLoadDebuggingHelpers;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool operator==(const CdbOptions &s1, const CdbOptions &s2)
|
inline bool operator==(const CdbOptions &s1, const CdbOptions &s2)
|
||||||
|
@@ -85,7 +85,7 @@ void CdbOptionsPageWidget::setOptions(CdbOptions &o)
|
|||||||
m_ui.symbolPathListEditor->setPathList(o.symbolPaths);
|
m_ui.symbolPathListEditor->setPathList(o.symbolPaths);
|
||||||
m_ui.sourcePathListEditor->setPathList(o.sourcePaths);
|
m_ui.sourcePathListEditor->setPathList(o.sourcePaths);
|
||||||
m_ui.verboseSymbolLoadingCheckBox->setChecked(o.verboseSymbolLoading);
|
m_ui.verboseSymbolLoadingCheckBox->setChecked(o.verboseSymbolLoading);
|
||||||
|
m_ui.fastLoadDebuggingHelpersCheckBox->setChecked(o.fastLoadDebuggingHelpers);
|
||||||
}
|
}
|
||||||
|
|
||||||
CdbOptions CdbOptionsPageWidget::options() const
|
CdbOptions CdbOptionsPageWidget::options() const
|
||||||
@@ -96,6 +96,7 @@ CdbOptions CdbOptionsPageWidget::options() const
|
|||||||
rc.symbolPaths = m_ui.symbolPathListEditor->pathList();
|
rc.symbolPaths = m_ui.symbolPathListEditor->pathList();
|
||||||
rc.sourcePaths = m_ui.sourcePathListEditor->pathList();
|
rc.sourcePaths = m_ui.sourcePathListEditor->pathList();
|
||||||
rc.verboseSymbolLoading = m_ui.verboseSymbolLoadingCheckBox->isChecked();
|
rc.verboseSymbolLoading = m_ui.verboseSymbolLoadingCheckBox->isChecked();
|
||||||
|
rc.fastLoadDebuggingHelpers = m_ui.fastLoadDebuggingHelpersCheckBox->isChecked();
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +133,8 @@ QString CdbOptionsPageWidget::searchKeywords() const
|
|||||||
QString rc;
|
QString rc;
|
||||||
QTextStream(&rc) << m_ui.pathLabel->text() << ' ' << m_ui.symbolPathLabel->text()
|
QTextStream(&rc) << m_ui.pathLabel->text() << ' ' << m_ui.symbolPathLabel->text()
|
||||||
<< ' ' << m_ui.sourcePathLabel->text()
|
<< ' ' << m_ui.sourcePathLabel->text()
|
||||||
<< ' ' << m_ui.verboseSymbolLoadingCheckBox->text();
|
<< ' ' << m_ui.verboseSymbolLoadingCheckBox->text()
|
||||||
|
<< ' ' << m_ui.fastLoadDebuggingHelpersCheckBox->text();
|
||||||
rc.remove(QLatin1Char('&'));
|
rc.remove(QLatin1Char('&'));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@@ -85,6 +85,9 @@
|
|||||||
<string>Other Options</string>
|
<string>Other Options</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QFormLayout" name="formLayout_3">
|
<layout class="QFormLayout" name="formLayout_3">
|
||||||
|
<property name="fieldGrowthPolicy">
|
||||||
|
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||||
|
</property>
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="verboseSymbolLoadingCheckBox">
|
<widget class="QCheckBox" name="verboseSymbolLoadingCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -92,6 +95,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QCheckBox" name="fastLoadDebuggingHelpersCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>fast loading of debugging helpers</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Reference in New Issue
Block a user