Commit ad9ff8ed authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Debugger: Fix exit crash.

Make sure DebuggerRunner::finished() is always connected to
handleFinished() (even for subclassed DebuggerRunners). Add
some more debugging information.
parent 616a9b13
......@@ -612,47 +612,74 @@ SourceFilesHandler *DebuggerEngine::sourceFilesHandler() const
QAbstractItemModel *DebuggerEngine::modulesModel() const
{
return d->m_modulesHandler.model();
QAbstractItemModel *model = d->m_modulesHandler.model();
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("ModulesModel"));
return model;
}
QAbstractItemModel *DebuggerEngine::breakModel() const
{
return d->m_breakHandler.model();
QAbstractItemModel *model = d->m_breakHandler.model();
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("BreakModel"));
return model;
}
QAbstractItemModel *DebuggerEngine::registerModel() const
{
return d->m_registerHandler.model();
QAbstractItemModel *model = d->m_registerHandler.model();
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("RegisterModel"));
return model;
}
QAbstractItemModel *DebuggerEngine::stackModel() const
{
return d->m_stackHandler.model();
QAbstractItemModel *model = d->m_stackHandler.model();
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("StackModel"));
return model;
}
QAbstractItemModel *DebuggerEngine::threadsModel() const
{
return d->m_threadsHandler.model();
QAbstractItemModel *model = d->m_threadsHandler.model();
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("ThreadsModel"));
return model;
}
QAbstractItemModel *DebuggerEngine::localsModel() const
{
return d->m_watchHandler.model(LocalsWatch);
QAbstractItemModel *model = d->m_watchHandler.model(LocalsWatch);
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("LocalsModel"));
return model;
}
QAbstractItemModel *DebuggerEngine::watchersModel() const
{
return d->m_watchHandler.model(WatchersWatch);
QAbstractItemModel *model = d->m_watchHandler.model(WatchersWatch);
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("WatchersModel"));
return model;
}
QAbstractItemModel *DebuggerEngine::returnModel() const
{
return d->m_watchHandler.model(ReturnWatch);
QAbstractItemModel *model = d->m_watchHandler.model(ReturnWatch);
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("ReturnModel"));
return model;
}
QAbstractItemModel *DebuggerEngine::sourceFilesModel() const
{
return d->m_sourceFilesHandler.model();
QAbstractItemModel *model = d->m_sourceFilesHandler.model();
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("SourceFilesModel"));
return model;
}
QAbstractItemModel *DebuggerEngine::commandModel() const
......
......@@ -2171,15 +2171,14 @@ void DebuggerPluginPrivate::setInitialState()
void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
{
//m_threadBox->setModel(engine->threadsModel());
//m_threadBox->setModel(engine->threadsModel());
QTC_ASSERT(engine != 0 && m_watchersWindow->model() != 0 && m_returnWindow->model() != 0, return);
m_threadBox->setCurrentIndex(engine->threadsHandler()->currentThread());
m_watchersWindow->setVisible(
m_watchersWindow->model()->rowCount(QModelIndex()) > 0);
m_returnWindow->setVisible(
m_returnWindow->model()->rowCount(QModelIndex()) > 0);
QTC_ASSERT(engine, return);
if (m_state == engine->state())
return;
......
......@@ -189,7 +189,6 @@ DebuggerRunControl *DebuggerRunControlFactory::create(
delete runControl;
return 0;
}
connect(runControl, SIGNAL(finished()), runControl, SLOT(handleFinished()));
return runControl;
}
......@@ -209,13 +208,14 @@ QWidget *DebuggerRunControlFactory::createConfigurationWidget
////////////////////////////////////////////////////////////////////////
DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration,
DebuggerEngineType enabledEngines, const DebuggerStartParameters &sp)
: RunControl(runConfiguration, ProjectExplorer::Constants::DEBUGMODE),
m_myRunConfiguration(runConfiguration)
DebuggerEngineType enabledEngines, const DebuggerStartParameters &sp) :
RunControl(runConfiguration, ProjectExplorer::Constants::DEBUGMODE),
m_engine(0),
m_myRunConfiguration(runConfiguration),
m_running(false),
m_enabledEngines(enabledEngines)
{
m_running = false;
m_enabledEngines = enabledEngines;
m_engine = 0;
connect(this, SIGNAL(finished()), this, SLOT(handleFinished()));
createEngine(sp);
}
......@@ -336,9 +336,6 @@ void DebuggerRunControl::createEngine(const DebuggerStartParameters &sp)
{
// Figure out engine according to toolchain, executable, attach or default.
DebuggerEngineType engineType = NoEngineType;
QString errorMessage;
QString settingsIdHint;
bool isQmlExecutable = sp.executable.endsWith(_("qmlviewer")) || sp.executable.endsWith(_("qmlobserver"));
#ifdef Q_OS_MAC
isQmlExecutable = sp.executable.endsWith(_("QMLViewer.app")) || sp.executable.endsWith(_("QMLObserver.app"));
......@@ -476,9 +473,9 @@ void DebuggerRunControl::start()
plugin()->showMessage(message, StatusBar);
plugin()->showMessage(DebuggerSettings::instance()->dump(), LogDebug);
plugin()->runControlStarted(this);
engine()->startDebugger(this);
m_running = true;
plugin()->runControlStarted(this);
emit started();
}
......
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