aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Stenger <[email protected]>2024-07-23 09:52:12 +0200
committerChristian Stenger <[email protected]>2024-07-23 09:03:40 +0000
commit370c2d7787ec291565f4749e370fdecea77d12b1 (patch)
tree7271bc41237db68f1187b4230299f7bbe752e4d9
parent7b4b1e2a7270232bde6477c248a27aa3d8dc80ad (diff)
Debugger: Fix snapshot handlingv14.0.0
Avoid sharing the workers with the engine creating the snapshot to avoid closing both when stopping the debugger engine for the snapshot. Correctly detach at finish to avoid having a runcontrol appearing still running. Fixes: QTCREATORBUG-31220 Change-Id: Iccb54b0fc2d7f5bf54b42a116e56c1a840b1f46e Reviewed-by: hjk <[email protected]>
-rw-r--r--src/plugins/debugger/debuggerruncontrol.cpp2
-rw-r--r--src/plugins/projectexplorer/runcontrol.cpp6
-rw-r--r--src/plugins/projectexplorer/runcontrol.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp
index 007d3464bb8..f4f1405953e 100644
--- a/src/plugins/debugger/debuggerruncontrol.cpp
+++ b/src/plugins/debugger/debuggerruncontrol.cpp
@@ -575,9 +575,11 @@ void DebuggerRunTool::start()
connect(engine, &DebuggerEngine::attachToCoreRequested, this, [this](const QString &coreFile) {
auto rc = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE);
rc->copyDataFromRunControl(runControl());
+ rc->resetDataForAttachToCore();
auto name = QString(Tr::tr("%1 - Snapshot %2").arg(runControl()->displayName()).arg(++d->snapshotCounter));
auto debugger = new DebuggerRunTool(rc);
debugger->setStartMode(AttachToCore);
+ debugger->setCloseMode(DetachAtClose);
debugger->setRunControlName(name);
debugger->setCoreFilePath(FilePath::fromString(coreFile), true);
debugger->startRunControl();
diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp
index 5eac3498bcf..4dd364aaf0a 100644
--- a/src/plugins/projectexplorer/runcontrol.cpp
+++ b/src/plugins/projectexplorer/runcontrol.cpp
@@ -364,6 +364,12 @@ void RunControl::copyDataFromRunControl(RunControl *runControl)
d->copyData(runControl->d.get());
}
+void RunControl::resetDataForAttachToCore()
+{
+ d->m_workers.clear();
+ d->state = RunControlState::Initialized;
+}
+
void RunControl::copyDataFromRunConfiguration(RunConfiguration *runConfig)
{
QTC_ASSERT(runConfig, return);
diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h
index 94288664361..b99439869ac 100644
--- a/src/plugins/projectexplorer/runcontrol.h
+++ b/src/plugins/projectexplorer/runcontrol.h
@@ -150,6 +150,7 @@ public:
void copyDataFromRunConfiguration(RunConfiguration *runConfig);
void copyDataFromRunControl(RunControl *runControl);
+ void resetDataForAttachToCore();
void setAutoDeleteOnStop(bool autoDelete);