Commit dcd57ab2 authored by hjk's avatar hjk
Browse files

debugger: try to make core file loading appear snappier

parent 3f98fb7f
......@@ -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());
......
......@@ -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;
......
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment