diff --git a/src/plugins/debugger/cdb/cdbdebugengine.cpp b/src/plugins/debugger/cdb/cdbdebugengine.cpp index b914986a0b4194d6b60caa751daeaf48744fe2f5..bccad9cc7a562ff231b4b3286cd2cb970501b99e 100644 --- a/src/plugins/debugger/cdb/cdbdebugengine.cpp +++ b/src/plugins/debugger/cdb/cdbdebugengine.cpp @@ -307,6 +307,7 @@ CdbDebugEnginePrivate::CdbDebugEnginePrivate(DebuggerManager *parent, bool CdbDebugEnginePrivate::init(QString *errorMessage) { + enum { bufLen = 10240 }; // Load the DLL DebuggerEngineLibrary lib; if (!lib.init(m_options->path, errorMessage)) @@ -343,6 +344,14 @@ bool CdbDebugEnginePrivate::init(QString *errorMessage) return false; } + WCHAR buf[bufLen]; + hr = m_cif.debugSymbols->GetImagePathWide(buf, bufLen, 0); + if (FAILED(hr)) { + *errorMessage = msgComFailed("GetImagePathWide", hr); + return false; + } + m_baseImagePath = QString::fromUtf16(buf); + hr = lib.debugCreate( __uuidof(IDebugRegisters2), reinterpret_cast<void**>(&m_cif.debugRegisters)); if (FAILED(hr)) { *errorMessage = QString::fromLatin1("Creation of IDebugRegisters2 failed: %1").arg(msgDebugEngineComResult(hr)); @@ -619,16 +628,22 @@ bool CdbDebugEngine::startDebuggerWithExecutable(DebuggerStartMode sm, QString * const QSharedPointer<DebuggerStartParameters> sp = m_d->m_debuggerManager->startParameters(); const QString filename(sp->executable); + // Set image path + const QFileInfo fi(filename); + QString imagePath = QDir::toNativeSeparators(fi.absolutePath()); + if (!m_d->m_baseImagePath.isEmpty()) { + imagePath += QLatin1Char(';'); + imagePath += m_d->m_baseImagePath; + } + m_d->m_cif.debugSymbols->SetImagePathWide(reinterpret_cast<PCWSTR>(imagePath.utf16())); if (debugCDB) - qDebug() << Q_FUNC_INFO <<filename; + qDebug() << Q_FUNC_INFO <<'\n' << filename << imagePath; - const QFileInfo fi(filename); - m_d->m_cif.debugSymbols->AppendImagePathWide(reinterpret_cast<PCWSTR>(QDir::toNativeSeparators(fi.absolutePath()).utf16())); - //m_cif.debugSymbols->SetSymbolOptions(SYMOPT_CASE_INSENSITIVE | SYMOPT_UNDNAME | SYMOPT_DEBUG | SYMOPT_LOAD_LINES | SYMOPT_OMAP_FIND_NEAREST | SYMOPT_AUTO_PUBLICS); - m_d->m_cif.debugSymbols->SetSymbolOptions(SYMOPT_CASE_INSENSITIVE | SYMOPT_UNDNAME | SYMOPT_LOAD_LINES | SYMOPT_OMAP_FIND_NEAREST | SYMOPT_AUTO_PUBLICS); - //m_cif.debugSymbols->AddSymbolOptions(SYMOPT_CASE_INSENSITIVE | SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS | SYMOPT_DEBUG | SYMOPT_LOAD_LINES | SYMOPT_OMAP_FIND_NEAREST | SYMOPT_AUTO_PUBLICS | SYMOPT_NO_IMAGE_SEARCH); + ULONG symbolOptions = SYMOPT_CASE_INSENSITIVE | SYMOPT_UNDNAME | SYMOPT_LOAD_LINES | SYMOPT_OMAP_FIND_NEAREST | SYMOPT_AUTO_PUBLICS; + if (m_d->m_options->verboseSymbolLoading) + symbolOptions |= SYMOPT_DEBUG; + m_d->m_cif.debugSymbols->SetSymbolOptions(symbolOptions); - // TODO console const QString cmd = Core::Utils::AbstractProcess::createWinCommandline(filename, sp->processArgs); if (debugCDB) qDebug() << "Starting " << cmd; diff --git a/src/plugins/debugger/cdb/cdbdebugengine_p.h b/src/plugins/debugger/cdb/cdbdebugengine_p.h index 53e6737343e70cd2d3fcdb7d434b984ef3612fc7..f34077a508cc8fd69d58366e4c120cdb11b83dff 100644 --- a/src/plugins/debugger/cdb/cdbdebugengine_p.h +++ b/src/plugins/debugger/cdb/cdbdebugengine_p.h @@ -157,6 +157,7 @@ struct CdbDebugEnginePrivate CdbDebugEventCallback m_debugEventCallBack; CdbDebugOutput m_debugOutputCallBack; QSharedPointer<CdbDumperHelper> m_dumper; + QString m_baseImagePath; CdbDebugEngine* m_engine; DebuggerManager *m_debuggerManager; diff --git a/src/plugins/debugger/cdb/cdboptions.cpp b/src/plugins/debugger/cdb/cdboptions.cpp index 9cb2af5b4bceee2cdd51758906ae1168880adae7..55c6699fabebcae2a5ed56af743fbbcc2d46fb65 100644 --- a/src/plugins/debugger/cdb/cdboptions.cpp +++ b/src/plugins/debugger/cdb/cdboptions.cpp @@ -38,18 +38,21 @@ static const char *enabledKeyC = "Enabled"; static const char *pathKeyC = "Path"; static const char *symbolPathsKeyC = "SymbolPaths"; static const char *sourcePathsKeyC = "SourcePaths"; +static const char *verboseSymbolLoadingKeyC = "SymbolPaths"; namespace Debugger { namespace Internal { CdbOptions::CdbOptions() : - enabled(false) + enabled(false), + verboseSymbolLoading(false) { } void CdbOptions::clear() { enabled = false; + verboseSymbolLoading = false; path.clear(); } @@ -69,6 +72,7 @@ void CdbOptions::fromSettings(const QSettings *s) path = s->value(keyRoot + QLatin1String(pathKeyC), QString()).toString(); symbolPaths = s->value(keyRoot + QLatin1String(symbolPathsKeyC), QStringList()).toStringList(); sourcePaths = s->value(keyRoot + QLatin1String(sourcePathsKeyC), QStringList()).toStringList(); + verboseSymbolLoading = s->value(keyRoot + QLatin1String(verboseSymbolLoadingKeyC), false).toBool(); } void CdbOptions::toSettings(QSettings *s) const @@ -78,6 +82,7 @@ void CdbOptions::toSettings(QSettings *s) const s->setValue(QLatin1String(pathKeyC), path); s->setValue(QLatin1String(symbolPathsKeyC), symbolPaths); s->setValue(QLatin1String(sourcePathsKeyC), sourcePaths); + s->setValue(QLatin1String(verboseSymbolLoadingKeyC), verboseSymbolLoading); s->endGroup(); } @@ -128,6 +133,8 @@ unsigned CdbOptions::compare(const CdbOptions &rhs) const rc |= InitializationOptionsChanged; if (symbolPaths != rhs.symbolPaths || sourcePaths != rhs.sourcePaths) rc |= DebuggerPathsChanged; + if (verboseSymbolLoading != rhs.verboseSymbolLoading) + rc |= SymbolOptionsChanged; return rc; } diff --git a/src/plugins/debugger/cdb/cdboptions.h b/src/plugins/debugger/cdb/cdboptions.h index a53c42307e416c68693c6ad4da912f3cb6396c51..b8ab1a1103b45f3724f90d7328af5ac0a4b84bc9 100644 --- a/src/plugins/debugger/cdb/cdboptions.h +++ b/src/plugins/debugger/cdb/cdboptions.h @@ -49,7 +49,9 @@ public: void toSettings(QSettings *s) const; // A set of flags for comparison function. - enum ChangeFlags { InitializationOptionsChanged = 0x1, DebuggerPathsChanged = 0x2 }; + enum ChangeFlags { InitializationOptionsChanged = 0x1, + DebuggerPathsChanged = 0x2, + SymbolOptionsChanged = 0x4 }; unsigned compare(const CdbOptions &s) const; // Locate the debugging tools @@ -59,6 +61,7 @@ public: QString path; QStringList symbolPaths; QStringList sourcePaths; + bool verboseSymbolLoading; }; 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 bb828fb68bcacb052de0ad3fce3cc010e09efcf5..91d861dd44fd91dd20b116ca013e665a9e1c1ef7 100644 --- a/src/plugins/debugger/cdb/cdboptionspage.cpp +++ b/src/plugins/debugger/cdb/cdboptionspage.cpp @@ -84,6 +84,8 @@ void CdbOptionsPageWidget::setOptions(CdbOptions &o) m_ui.cdbPathGroupBox->setChecked(o.enabled); m_ui.symbolPathListEditor->setPathList(o.symbolPaths); m_ui.sourcePathListEditor->setPathList(o.sourcePaths); + m_ui.verboseSymbolLoadingCheckBox->setChecked(o.verboseSymbolLoading); + } CdbOptions CdbOptionsPageWidget::options() const @@ -93,6 +95,7 @@ CdbOptions CdbOptionsPageWidget::options() const rc.enabled = m_ui.cdbPathGroupBox->isChecked(); rc.symbolPaths = m_ui.symbolPathListEditor->pathList(); rc.sourcePaths = m_ui.sourcePathListEditor->pathList(); + rc.verboseSymbolLoading = m_ui.verboseSymbolLoadingCheckBox->isChecked(); return rc; } @@ -167,11 +170,17 @@ void CdbOptionsPage::apply() if (!m_widget) return; const CdbOptions newOptions = m_widget->options(); - if (const unsigned changedMask = m_options->compare(newOptions)) { + if (unsigned changedMask = m_options->compare(newOptions)) { *m_options = newOptions; m_options->toSettings(Core::ICore::instance()->settings()); - if (changedMask & CdbOptions::DebuggerPathsChanged) + // Paths changed? + if (changedMask & CdbOptions::DebuggerPathsChanged) { emit debuggerPathsChanged(); + changedMask &= ~CdbOptions::DebuggerPathsChanged; + } + // Remaining options? + if (changedMask) + emit optionsChanged(); } } diff --git a/src/plugins/debugger/cdb/cdboptionspage.h b/src/plugins/debugger/cdb/cdboptionspage.h index cc996815f197872802e65cfb87e3d224d4cadcb0..f07b7bd17cd542c7397afeb6836fdc57dd942292 100644 --- a/src/plugins/debugger/cdb/cdboptionspage.h +++ b/src/plugins/debugger/cdb/cdboptionspage.h @@ -86,6 +86,7 @@ public: signals: void debuggerPathsChanged(); + void optionsChanged(); private: const QSharedPointer<CdbOptions> m_options; diff --git a/src/plugins/debugger/cdb/cdboptionspagewidget.ui b/src/plugins/debugger/cdb/cdboptionspagewidget.ui index 8b1bf10f1c646b50ec60ab60faba57ca43e226bd..b998e7c6f3c05408deae5d381423cdab85afdc55 100644 --- a/src/plugins/debugger/cdb/cdboptionspagewidget.ui +++ b/src/plugins/debugger/cdb/cdboptionspagewidget.ui @@ -38,7 +38,7 @@ <item row="0" column="0" colspan="2"> <widget class="QLabel" name="noteLabel"> <property name="text"> - <string extracomment="Placeholder" notr="true">Note: bla, blah</string> + <string notr="true" extracomment="Placeholder">Note: bla, blah</string> </property> </widget> </item> @@ -79,6 +79,22 @@ </layout> </widget> </item> + <item> + <widget class="QGroupBox" name="variousOptionsGroupBox"> + <property name="title"> + <string>Other options</string> + </property> + <layout class="QFormLayout" name="formLayout_3"> + <item row="0" column="0" colspan="2"> + <widget class="QCheckBox" name="verboseSymbolLoadingCheckBox"> + <property name="text"> + <string>Verbose Symbol Loading</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> <item> <spacer name="verticalSpacer"> <property name="orientation">