diff --git a/src/plugins/debugger/cdb/cdbdebugengine.cpp b/src/plugins/debugger/cdb/cdbdebugengine.cpp index 30b8514a13cee7d74ac5ec9566d6b5464a9de024..50518853468817f2b482cd6e2fc8f506b152d968 100644 --- a/src/plugins/debugger/cdb/cdbdebugengine.cpp +++ b/src/plugins/debugger/cdb/cdbdebugengine.cpp @@ -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__); diff --git a/src/plugins/debugger/cdb/cdbdumperhelper.cpp b/src/plugins/debugger/cdb/cdbdumperhelper.cpp index 0a0a2f4b9424038ce72fb615ceca8f1b488f7897..46429bab5d246bceae3705d67bcabe0095043af8 100644 --- a/src/plugins/debugger/cdb/cdbdumperhelper.cpp +++ b/src/plugins/debugger/cdb/cdbdumperhelper.cpp @@ -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); - 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 + 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; + } // 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); diff --git a/src/plugins/debugger/cdb/cdbdumperhelper.h b/src/plugins/debugger/cdb/cdbdumperhelper.h index a7742685e8deae1f2b015e43fd756b62398b2ded..04eca802bf532ed811a13b6c73fb88ed0eb7be6e 100644 --- a/src/plugins/debugger/cdb/cdbdumperhelper.h +++ b/src/plugins/debugger/cdb/cdbdumperhelper.h @@ -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 diff --git a/src/plugins/debugger/cdb/cdboptions.cpp b/src/plugins/debugger/cdb/cdboptions.cpp index fda335be03c7ab6f3e3f53cc1194d922f7d4e23f..5be73f90d780ff0557a1d172f569fb29f8ad06aa 100644 --- a/src/plugins/debugger/cdb/cdboptions.cpp +++ b/src/plugins/debugger/cdb/cdboptions.cpp @@ -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; } diff --git a/src/plugins/debugger/cdb/cdboptions.h b/src/plugins/debugger/cdb/cdboptions.h index cb7bd07ef2ce782aa6373116f1528c2602465aeb..0428341dccbbc839aa07d2bcace80f13abc029f5 100644 --- a/src/plugins/debugger/cdb/cdboptions.h +++ b/src/plugins/debugger/cdb/cdboptions.h @@ -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) diff --git a/src/plugins/debugger/cdb/cdboptionspage.cpp b/src/plugins/debugger/cdb/cdboptionspage.cpp index 4804a242aed6b259f0c5e4ca492ba5662331451d..efae5a75f674864f76b229927208daa91eda5aa4 100644 --- a/src/plugins/debugger/cdb/cdboptionspage.cpp +++ b/src/plugins/debugger/cdb/cdboptionspage.cpp @@ -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; } diff --git a/src/plugins/debugger/cdb/cdboptionspagewidget.ui b/src/plugins/debugger/cdb/cdboptionspagewidget.ui index c84109e3a7e2479fc7eca73357268697be1dc156..505f7c8bf42f00cfad3dafd052338aaa367fe142 100644 --- a/src/plugins/debugger/cdb/cdboptionspagewidget.ui +++ b/src/plugins/debugger/cdb/cdboptionspagewidget.ui @@ -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>