summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2009-07-27 15:32:46 +0200
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2009-07-27 15:32:46 +0200
commitb41d3a45ad374df97724a225b8f0ceb936f180e3 (patch)
tree7896b4da81b79b9696e75223ed00734e29e9575b /src
parent5c8566709d0f78d39f90905fb5f981585a57d99a (diff)
downloadqt-creator-b41d3a45ad374df97724a225b8f0ceb936f180e3.tar.gz
CDB: Added option for verbose symbol loading, fixed image path.
Do not add all image paths (from different projects), keep a base path and add current.
Diffstat (limited to 'src')
-rw-r--r--src/plugins/debugger/cdb/cdbdebugengine.cpp29
-rw-r--r--src/plugins/debugger/cdb/cdbdebugengine_p.h1
-rw-r--r--src/plugins/debugger/cdb/cdboptions.cpp9
-rw-r--r--src/plugins/debugger/cdb/cdboptions.h5
-rw-r--r--src/plugins/debugger/cdb/cdboptionspage.cpp13
-rw-r--r--src/plugins/debugger/cdb/cdboptionspage.h1
-rw-r--r--src/plugins/debugger/cdb/cdboptionspagewidget.ui18
7 files changed, 64 insertions, 12 deletions
diff --git a/src/plugins/debugger/cdb/cdbdebugengine.cpp b/src/plugins/debugger/cdb/cdbdebugengine.cpp
index b914986a0b..bccad9cc7a 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 53e6737343..f34077a508 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 9cb2af5b4b..55c6699fab 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 a53c42307e..b8ab1a1103 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 bb828fb68b..91d861dd44 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 cc996815f1..f07b7bd17c 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 8b1bf10f1c..b998e7c6f3 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>
@@ -80,6 +80,22 @@
</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">
<enum>Qt::Vertical</enum>