summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2010-12-21 14:41:17 +0100
committerhjk <qtc-committer@nokia.com>2010-12-21 14:46:42 +0100
commitdcd57ab2df97a2004d3530059eeda739fc0479b7 (patch)
tree332fbc0826b8dc48cfd69f50422f0ea75f7f3650
parent3f98fb7f63fc16dd8d23686f68c726de57ce13cc (diff)
downloadqt-creator-dcd57ab2df97a2004d3530059eeda739fc0479b7.tar.gz
debugger: try to make core file loading appear snappier
-rw-r--r--src/plugins/debugger/gdb/coregdbadapter.cpp31
-rw-r--r--src/plugins/debugger/gdb/coregdbadapter.h4
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp12
3 files changed, 39 insertions, 8 deletions
diff --git a/src/plugins/debugger/gdb/coregdbadapter.cpp b/src/plugins/debugger/gdb/coregdbadapter.cpp
index 69afdb148b..5f37b36333 100644
--- a/src/plugins/debugger/gdb/coregdbadapter.cpp
+++ b/src/plugins/debugger/gdb/coregdbadapter.cpp
@@ -75,7 +75,10 @@ void CoreGdbAdapter::startAdapter()
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
showMessage(_("TRYING TO START ADAPTER"));
- if (!m_engine->startGdb())
+ QStringList args;
+ args.append(_("-ex"));
+ args.append(_("set auto-solib-add off"));
+ if (!m_engine->startGdb(args))
return;
//if (m_executable.isEmpty()) {
@@ -149,10 +152,11 @@ void CoreGdbAdapter::handleTemporaryTargetCore(const GdbResponse &response)
void CoreGdbAdapter::handleTemporaryDetach(const GdbResponse &response)
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
- if (response.resultClass == GdbResultDone)
+ if (response.resultClass == GdbResultDone) {
m_engine->notifyEngineSetupOk();
- else
+ } else {
m_engine->notifyEngineSetupFailed();
+ }
}
void CoreGdbAdapter::setupInferior()
@@ -193,6 +197,10 @@ void CoreGdbAdapter::handleTargetCore(const GdbResponse &response)
m_engine->loadPythonDumpers();
showMessage(tr("Attached to core."), StatusBar);
m_engine->handleInferiorPrepared();
+ // Due to the auto-solib-add off setting, we don't have any
+ // symbols yet. Load them in order of importance.
+ m_engine->reloadStack(true);
+ m_engine->postCommand("info shared", CB(handleModulesList));
return;
}
QString msg = tr("Attach to core \"%1\" failed:\n")
@@ -201,6 +209,23 @@ void CoreGdbAdapter::handleTargetCore(const GdbResponse &response)
m_engine->notifyInferiorSetupFailed(msg);
}
+void CoreGdbAdapter::handleModulesList(const GdbResponse &response)
+{
+ m_engine->handleModulesList(response);
+ loadSymbolsForStack();
+}
+
+void CoreGdbAdapter::loadSymbolsForStack()
+{
+ m_engine->loadSymbolsForStack();
+ QTimer::singleShot(1000, this, SLOT(loadAllSymbols()));
+}
+
+void CoreGdbAdapter::loadAllSymbols()
+{
+ m_engine->loadAllSymbols();
+}
+
void CoreGdbAdapter::runEngine()
{
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
diff --git a/src/plugins/debugger/gdb/coregdbadapter.h b/src/plugins/debugger/gdb/coregdbadapter.h
index 1a0fafd2bb..d7414adf6e 100644
--- a/src/plugins/debugger/gdb/coregdbadapter.h
+++ b/src/plugins/debugger/gdb/coregdbadapter.h
@@ -63,12 +63,16 @@ private:
void shutdownInferior();
void shutdownAdapter();
+ Q_SLOT void loadSymbolsForStack();
+ Q_SLOT void loadAllSymbols();
+
AbstractGdbProcess *gdbProc() { return &m_gdbProc; }
void handleTemporaryDetach(const GdbResponse &response);
void handleTemporaryTargetCore(const GdbResponse &response);
void handleFileExecAndSymbols(const GdbResponse &response);
void handleTargetCore(const GdbResponse &response);
+ void handleModulesList(const GdbResponse &response);
QString m_executable;
const QByteArray m_coreName;
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 729ede4b46..7765d7243f 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -2636,7 +2636,7 @@ void GdbEngine::loadSymbolsForStack()
const Modules &modules = modulesHandler()->modules();
foreach (const StackFrame &frame, stackHandler()->frames()) {
if (frame.function == _("??")) {
- qDebug() << "LOAD FOR " << frame.address;
+ //qDebug() << "LOAD FOR " << frame.address;
foreach (const Module &module, modules) {
if (module.startAddress <= frame.address
&& frame.address < module.endAddress) {
@@ -4369,10 +4369,12 @@ void GdbEngine::handleInferiorPrepared()
#endif
}
- // Initial attempt to set breakpoints
- showStatusMessage(tr("Setting breakpoints..."));
- showMessage(tr("Setting breakpoints..."));
- attemptBreakpointSynchronization();
+ // Initial attempt to set breakpoints.
+ if (startParameters().startMode != AttachCore) {
+ showStatusMessage(tr("Setting breakpoints..."));
+ showMessage(tr("Setting breakpoints..."));
+ attemptBreakpointSynchronization();
+ }
if (m_cookieForToken.isEmpty()) {
finishInferiorSetup();