summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2010-07-23 15:50:37 +0200
committercon <qtc-committer@nokia.com>2010-07-26 14:08:11 +0200
commit027efa84c92aec613a3e03d902fc74c9f3daa948 (patch)
tree76ff9f6cab666504ed0948ae5f31e1e1e3d46571
parente69ebd460e8a2318dab6183b9961db08752be3fb (diff)
downloadqt-creator-027efa84c92aec613a3e03d902fc74c9f3daa948.tar.gz
cdb plugin: make the fast dumper initialization an option
Fast dumper init is now on by default. Reviewed-by: Robert Loehning (cherry picked from commit 66d75056aefaffe908b50461bf549111af0466d5)
-rw-r--r--src/plugins/debugger/cdb/cdbdebugengine.cpp1
-rw-r--r--src/plugins/debugger/cdb/cdbdumperhelper.cpp37
-rw-r--r--src/plugins/debugger/cdb/cdbdumperhelper.h3
-rw-r--r--src/plugins/debugger/cdb/cdboptions.cpp9
-rw-r--r--src/plugins/debugger/cdb/cdboptions.h4
-rw-r--r--src/plugins/debugger/cdb/cdboptionspage.cpp6
-rw-r--r--src/plugins/debugger/cdb/cdboptionspagewidget.ui10
7 files changed, 48 insertions, 22 deletions
diff --git a/src/plugins/debugger/cdb/cdbdebugengine.cpp b/src/plugins/debugger/cdb/cdbdebugengine.cpp
index 30b8514a13..5051885346 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 0a0a2f4b94..46429bab5d 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 a7742685e8..04eca802bf 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 fda335be03..5be73f90d7 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 cb7bd07ef2..0428341dcc 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 4804a242ae..efae5a75f6 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 c84109e3a7..505f7c8bf4 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>