Commit c5c0dc76 authored by hjk's avatar hjk
Browse files

debugger: restore session breakpoints if RunControl finishes

parent b01a622f
......@@ -964,21 +964,18 @@ void BreakHandler::removeAllBreakpoints()
for (int index = size(); --index >= 0;)
removeBreakpointHelper(index);
emit layoutChanged();
saveBreakpoints();
//saveBreakpoints();
updateMarkers();
}
/*
void BreakHandler::setAllPending()
{
QTC_ASSERT(false, /*ABC*/ return);
/*
loadBreakpoints();
for (int index = size(); --index >= 0;)
at(index)->pending = true;
saveBreakpoints();
updateMarkers();
*/
}
*/
void BreakHandler::saveSessionData()
{
......@@ -1016,7 +1013,7 @@ void BreakHandler::initializeFromTemplate(BreakHandler *other)
//qDebug() << "COPYING BREAKPOINTS INTO NEW SESSION";
QTC_ASSERT(m_bp.isEmpty(), /**/);
foreach (BreakpointData *data, other->m_bp)
m_bp.append(data->clone());
append(data->clone());
updateMarkers();
}
......
......@@ -56,7 +56,7 @@ public:
~BreakHandler();
void removeAllBreakpoints();
void setAllPending();
//void setAllPending();
void loadSessionData();
void saveSessionData();
......
......@@ -678,16 +678,23 @@ void DebuggerManager::executeJumpToLine()
}
*/
void DebuggerEngine::cleanup()
// Called from RunControl.
void DebuggerEngine::handleFinished()
{
/*
FIXME ABS: Still needed?
modulesHandler()->removeAll();
breakHandler()->setAllPending();
//breakHandler()->setAllPending();
stackHandler()->removeAll();
threadsHandler()->removeAll();
watchHandler()->cleanup();
*/
DebuggerEngine *sessionTemplate = plugin()->sessionTemplate();
if (sessionTemplate != this) {
BreakHandler *handler = sessionTemplate->breakHandler();
qDebug() << "MOVING BREAKPOINTS TO SESSION";
handler->removeAllBreakpoints();
handler->initializeFromTemplate(breakHandler());
}
breakHandler()->removeAllBreakpoints();
}
const DebuggerStartParameters &DebuggerEngine::startParameters() const
......
......@@ -216,7 +216,7 @@ public:
QAbstractItemModel *snapshotModel() const;
QAbstractItemModel *sourceFilesModel() const;
void cleanup();
void handleFinished();
bool debuggerActionsEnabled() const;
static bool debuggerActionsEnabled(DebuggerState state);
void showModuleSymbols(const QString &moduleName, const Symbols &symbols);
......
......@@ -2683,6 +2683,7 @@ void DebuggerPlugin::runControlStarted(DebuggerRunControl *runControl)
void DebuggerPlugin::runControlFinished(DebuggerRunControl *runControl)
{
Q_UNUSED(runControl);
d->disconnectEngine();
qDebug() << "RUNCONTROL FINISHED: " << runControl;
}
......
......@@ -209,6 +209,15 @@ DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration)
m_enabledEngines = AllEngineTypes;
}
DebuggerRunControl::~DebuggerRunControl()
{
disconnect();
DebuggerEngine *engine = m_engine;
m_engine = 0;
engine->disconnect();
delete engine;
}
static DebuggerEngineType engineForToolChain(int toolChainType)
{
switch (toolChainType) {
......@@ -372,11 +381,6 @@ void DebuggerRunControl::createEngine(const DebuggerStartParameters &sp)
}
}
DebuggerRunControl::~DebuggerRunControl()
{
delete m_engine;
}
QString DebuggerRunControl::displayName() const
{
QTC_ASSERT(m_engine, return QString());
......@@ -481,6 +485,7 @@ void DebuggerRunControl::handleStarted()
void DebuggerRunControl::handleFinished()
{
engine()->handleFinished();
plugin()->runControlFinished(this);
}
......
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