forked from qt-creator/qt-creator
debugger: try to make core file loading appear snappier
This commit is contained in:
@@ -75,7 +75,10 @@ void CoreGdbAdapter::startAdapter()
|
|||||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||||
showMessage(_("TRYING TO START ADAPTER"));
|
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;
|
return;
|
||||||
|
|
||||||
//if (m_executable.isEmpty()) {
|
//if (m_executable.isEmpty()) {
|
||||||
@@ -149,11 +152,12 @@ void CoreGdbAdapter::handleTemporaryTargetCore(const GdbResponse &response)
|
|||||||
void CoreGdbAdapter::handleTemporaryDetach(const GdbResponse &response)
|
void CoreGdbAdapter::handleTemporaryDetach(const GdbResponse &response)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||||
if (response.resultClass == GdbResultDone)
|
if (response.resultClass == GdbResultDone) {
|
||||||
m_engine->notifyEngineSetupOk();
|
m_engine->notifyEngineSetupOk();
|
||||||
else
|
} else {
|
||||||
m_engine->notifyEngineSetupFailed();
|
m_engine->notifyEngineSetupFailed();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CoreGdbAdapter::setupInferior()
|
void CoreGdbAdapter::setupInferior()
|
||||||
{
|
{
|
||||||
@@ -193,6 +197,10 @@ void CoreGdbAdapter::handleTargetCore(const GdbResponse &response)
|
|||||||
m_engine->loadPythonDumpers();
|
m_engine->loadPythonDumpers();
|
||||||
showMessage(tr("Attached to core."), StatusBar);
|
showMessage(tr("Attached to core."), StatusBar);
|
||||||
m_engine->handleInferiorPrepared();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
QString msg = tr("Attach to core \"%1\" failed:\n")
|
QString msg = tr("Attach to core \"%1\" failed:\n")
|
||||||
@@ -201,6 +209,23 @@ void CoreGdbAdapter::handleTargetCore(const GdbResponse &response)
|
|||||||
m_engine->notifyInferiorSetupFailed(msg);
|
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()
|
void CoreGdbAdapter::runEngine()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
|
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
|
||||||
|
|||||||
@@ -63,12 +63,16 @@ private:
|
|||||||
void shutdownInferior();
|
void shutdownInferior();
|
||||||
void shutdownAdapter();
|
void shutdownAdapter();
|
||||||
|
|
||||||
|
Q_SLOT void loadSymbolsForStack();
|
||||||
|
Q_SLOT void loadAllSymbols();
|
||||||
|
|
||||||
AbstractGdbProcess *gdbProc() { return &m_gdbProc; }
|
AbstractGdbProcess *gdbProc() { return &m_gdbProc; }
|
||||||
|
|
||||||
void handleTemporaryDetach(const GdbResponse &response);
|
void handleTemporaryDetach(const GdbResponse &response);
|
||||||
void handleTemporaryTargetCore(const GdbResponse &response);
|
void handleTemporaryTargetCore(const GdbResponse &response);
|
||||||
void handleFileExecAndSymbols(const GdbResponse &response);
|
void handleFileExecAndSymbols(const GdbResponse &response);
|
||||||
void handleTargetCore(const GdbResponse &response);
|
void handleTargetCore(const GdbResponse &response);
|
||||||
|
void handleModulesList(const GdbResponse &response);
|
||||||
|
|
||||||
QString m_executable;
|
QString m_executable;
|
||||||
const QByteArray m_coreName;
|
const QByteArray m_coreName;
|
||||||
|
|||||||
@@ -2636,7 +2636,7 @@ void GdbEngine::loadSymbolsForStack()
|
|||||||
const Modules &modules = modulesHandler()->modules();
|
const Modules &modules = modulesHandler()->modules();
|
||||||
foreach (const StackFrame &frame, stackHandler()->frames()) {
|
foreach (const StackFrame &frame, stackHandler()->frames()) {
|
||||||
if (frame.function == _("??")) {
|
if (frame.function == _("??")) {
|
||||||
qDebug() << "LOAD FOR " << frame.address;
|
//qDebug() << "LOAD FOR " << frame.address;
|
||||||
foreach (const Module &module, modules) {
|
foreach (const Module &module, modules) {
|
||||||
if (module.startAddress <= frame.address
|
if (module.startAddress <= frame.address
|
||||||
&& frame.address < module.endAddress) {
|
&& frame.address < module.endAddress) {
|
||||||
@@ -4369,10 +4369,12 @@ void GdbEngine::handleInferiorPrepared()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initial attempt to set breakpoints
|
// Initial attempt to set breakpoints.
|
||||||
|
if (startParameters().startMode != AttachCore) {
|
||||||
showStatusMessage(tr("Setting breakpoints..."));
|
showStatusMessage(tr("Setting breakpoints..."));
|
||||||
showMessage(tr("Setting breakpoints..."));
|
showMessage(tr("Setting breakpoints..."));
|
||||||
attemptBreakpointSynchronization();
|
attemptBreakpointSynchronization();
|
||||||
|
}
|
||||||
|
|
||||||
if (m_cookieForToken.isEmpty()) {
|
if (m_cookieForToken.isEmpty()) {
|
||||||
finishInferiorSetup();
|
finishInferiorSetup();
|
||||||
|
|||||||
Reference in New Issue
Block a user