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;
|
||||
}
|
||||
}
|
||||
m_d->m_dumper->setFastSymbolResolution(m_d->m_options->fastLoadDebuggingHelpers);
|
||||
m_d->m_dumper->reset(dumperLibName, dumperEnabled);
|
||||
|
||||
setState(InferiorStarting, Q_FUNC_INFO, __LINE__);
|
||||
|
@@ -307,7 +307,8 @@ CdbDumperHelper::CdbDumperHelper(DebuggerManager *manager,
|
||||
m_outBufferSize(0),
|
||||
m_buffer(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.
|
||||
if (loadDebug)
|
||||
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;
|
||||
#else
|
||||
m_dumpObjectSymbol = QLatin1String("*qDumpObjectData440");
|
||||
QString inBufferSymbol = QLatin1String("*qDumpInBuffer");
|
||||
QString outBufferSymbol = QLatin1String("*qDumpOutBuffer");
|
||||
const QString dumperModuleName = QLatin1String(dumperModuleNameC);
|
||||
QString inBufferSymbol, outBufferSymbol;
|
||||
if (m_fastSymbolResolution) {
|
||||
// Symbols in the debugging helpers are never namespaced.
|
||||
m_dumpObjectSymbol = dumperModuleName + QLatin1String("!qDumpObjectData440");
|
||||
inBufferSymbol = dumperModuleName + QLatin1String("!qDumpInBuffer");
|
||||
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;
|
||||
#endif
|
||||
}
|
||||
// Determine buffer addresses, sizes and alloc buffer
|
||||
rc = getSymbolAddress(m_coreEngine->interfaces().debugSymbols, inBufferSymbol, &m_inBufferAddress, &m_inBufferSize, errorMessage)
|
||||
&& getSymbolAddress(m_coreEngine->interfaces().debugSymbols, outBufferSymbol, &m_outBufferAddress, &m_outBufferSize, errorMessage);
|
||||
|
@@ -92,6 +92,8 @@ public:
|
||||
State state() const { return m_state; }
|
||||
bool isEnabled() const { return m_state != Disabled; }
|
||||
|
||||
void setFastSymbolResolution(bool b) { m_fastSymbolResolution = b; }
|
||||
|
||||
// Disable in case of a debuggee crash.
|
||||
void disable();
|
||||
|
||||
@@ -156,6 +158,7 @@ private:
|
||||
QtDumperHelper m_helper;
|
||||
unsigned long m_dumperCallThread;
|
||||
QString m_goCommand;
|
||||
bool m_fastSymbolResolution;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -40,13 +40,15 @@ static const char *pathKeyC = "Path";
|
||||
static const char *symbolPathsKeyC = "SymbolPaths";
|
||||
static const char *sourcePathsKeyC = "SourcePaths";
|
||||
static const char *verboseSymbolLoadingKeyC = "VerboseSymbolLoading";
|
||||
static const char *fastLoadDebuggingHelpersKeyC = "FastLoadDebuggingHelpers";
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
CdbOptions::CdbOptions() :
|
||||
enabled(false),
|
||||
verboseSymbolLoading(false)
|
||||
verboseSymbolLoading(false),
|
||||
fastLoadDebuggingHelpers(true)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -54,6 +56,7 @@ void CdbOptions::clear()
|
||||
{
|
||||
enabled = false;
|
||||
verboseSymbolLoading = false;
|
||||
fastLoadDebuggingHelpers = true;
|
||||
path.clear();
|
||||
}
|
||||
|
||||
@@ -74,6 +77,7 @@ void CdbOptions::fromSettings(const QSettings *s)
|
||||
symbolPaths = s->value(keyRoot + QLatin1String(symbolPathsKeyC), QStringList()).toStringList();
|
||||
sourcePaths = s->value(keyRoot + QLatin1String(sourcePathsKeyC), QStringList()).toStringList();
|
||||
verboseSymbolLoading = s->value(keyRoot + QLatin1String(verboseSymbolLoadingKeyC), false).toBool();
|
||||
fastLoadDebuggingHelpers = s->value(keyRoot + QLatin1String(fastLoadDebuggingHelpersKeyC), true).toBool();
|
||||
}
|
||||
|
||||
void CdbOptions::toSettings(QSettings *s) const
|
||||
@@ -84,6 +88,7 @@ void CdbOptions::toSettings(QSettings *s) const
|
||||
s->setValue(QLatin1String(symbolPathsKeyC), symbolPaths);
|
||||
s->setValue(QLatin1String(sourcePathsKeyC), sourcePaths);
|
||||
s->setValue(QLatin1String(verboseSymbolLoadingKeyC), verboseSymbolLoading);
|
||||
s->setValue(QLatin1String(fastLoadDebuggingHelpersKeyC), fastLoadDebuggingHelpers);
|
||||
s->endGroup();
|
||||
}
|
||||
|
||||
@@ -96,6 +101,8 @@ unsigned CdbOptions::compare(const CdbOptions &rhs) const
|
||||
rc |= DebuggerPathsChanged;
|
||||
if (verboseSymbolLoading != rhs.verboseSymbolLoading)
|
||||
rc |= SymbolOptionsChanged;
|
||||
if (fastLoadDebuggingHelpers != rhs.fastLoadDebuggingHelpers)
|
||||
rc |= FastLoadDebuggingHelpersChanged;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@@ -51,7 +51,8 @@ public:
|
||||
// A set of flags for comparison function.
|
||||
enum ChangeFlags { InitializationOptionsChanged = 0x1,
|
||||
DebuggerPathsChanged = 0x2,
|
||||
SymbolOptionsChanged = 0x4 };
|
||||
SymbolOptionsChanged = 0x4,
|
||||
FastLoadDebuggingHelpersChanged = 0x8 };
|
||||
unsigned compare(const CdbOptions &s) const;
|
||||
|
||||
bool enabled;
|
||||
@@ -59,6 +60,7 @@ public:
|
||||
QStringList symbolPaths;
|
||||
QStringList sourcePaths;
|
||||
bool verboseSymbolLoading;
|
||||
bool fastLoadDebuggingHelpers;
|
||||
};
|
||||
|
||||
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.sourcePathListEditor->setPathList(o.sourcePaths);
|
||||
m_ui.verboseSymbolLoadingCheckBox->setChecked(o.verboseSymbolLoading);
|
||||
|
||||
m_ui.fastLoadDebuggingHelpersCheckBox->setChecked(o.fastLoadDebuggingHelpers);
|
||||
}
|
||||
|
||||
CdbOptions CdbOptionsPageWidget::options() const
|
||||
@@ -96,6 +96,7 @@ CdbOptions CdbOptionsPageWidget::options() const
|
||||
rc.symbolPaths = m_ui.symbolPathListEditor->pathList();
|
||||
rc.sourcePaths = m_ui.sourcePathListEditor->pathList();
|
||||
rc.verboseSymbolLoading = m_ui.verboseSymbolLoadingCheckBox->isChecked();
|
||||
rc.fastLoadDebuggingHelpers = m_ui.fastLoadDebuggingHelpersCheckBox->isChecked();
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -132,7 +133,8 @@ QString CdbOptionsPageWidget::searchKeywords() const
|
||||
QString rc;
|
||||
QTextStream(&rc) << m_ui.pathLabel->text() << ' ' << m_ui.symbolPathLabel->text()
|
||||
<< ' ' << m_ui.sourcePathLabel->text()
|
||||
<< ' ' << m_ui.verboseSymbolLoadingCheckBox->text();
|
||||
<< ' ' << m_ui.verboseSymbolLoadingCheckBox->text()
|
||||
<< ' ' << m_ui.fastLoadDebuggingHelpersCheckBox->text();
|
||||
rc.remove(QLatin1Char('&'));
|
||||
return rc;
|
||||
}
|
||||
|
@@ -85,6 +85,9 @@
|
||||
<string>Other Options</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="verboseSymbolLoadingCheckBox">
|
||||
<property name="text">
|
||||
@@ -92,6 +95,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
</widget>
|
||||
</item>
|
||||
|
Reference in New Issue
Block a user