[llvm-branch-commits] [lldb] release/22.x: [lldb-dap] Fix debugger initialisation order in DAP::InitializeDebugger (#178022) (PR #178466)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jan 28 08:59:58 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: None (llvmbot)
<details>
<summary>Changes</summary>
Backport fa3b3a0be13c3921d983375b1d0ac03d3d2b725d
Requested by: @<!-- -->da-viper
---
Full diff: https://github.com/llvm/llvm-project/pull/178466.diff
1 Files Affected:
- (modified) lldb/tools/lldb-dap/DAP.cpp (+6-4)
``````````diff
diff --git a/lldb/tools/lldb-dap/DAP.cpp b/lldb/tools/lldb-dap/DAP.cpp
index f09575ce8ba42..8bc4727378df6 100644
--- a/lldb/tools/lldb-dap/DAP.cpp
+++ b/lldb/tools/lldb-dap/DAP.cpp
@@ -1312,21 +1312,23 @@ void DAP::StartEventThreads() {
llvm::Error DAP::InitializeDebugger(const DAPSession &session) {
// Find the existing debugger by ID
- debugger = lldb::SBDebugger::FindDebuggerWithID(session.debuggerId);
- if (!debugger.IsValid()) {
+ lldb::SBDebugger found_debugger =
+ lldb::SBDebugger::FindDebuggerWithID(session.debuggerId);
+ if (!found_debugger.IsValid()) {
return llvm::createStringError(
"Unable to find existing debugger for debugger ID");
}
// Find the target within the debugger by its globally unique ID
lldb::SBTarget target =
- debugger.FindTargetByGloballyUniqueID(session.targetId);
+ found_debugger.FindTargetByGloballyUniqueID(session.targetId);
if (!target.IsValid()) {
return llvm::createStringError(
"Unable to find existing target for target ID");
}
- // Set the target for this DAP session.
+ // Set the target and debugger for this DAP session.
+ debugger = found_debugger;
SetTarget(target);
StartEventThreads();
return llvm::Error::success();
``````````
</details>
https://github.com/llvm/llvm-project/pull/178466
More information about the llvm-branch-commits
mailing list