Skip to content

[lldb] Store the dummy target in the selected exeuction context #149615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JDevlieghere
Copy link
Member

No description provided.

@llvmbot llvmbot added the lldb label Jul 18, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 18, 2025

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/149615.diff

2 Files Affected:

  • (modified) lldb/source/Core/Debugger.cpp (+2-2)
  • (modified) lldb/source/Core/Statusline.cpp (+1-5)
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index ed674ee1275c7..3a3fb9eb0bdaa 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -1221,8 +1221,8 @@ void Debugger::RedrawStatusline(bool update) {
 }
 
 ExecutionContext Debugger::GetSelectedExecutionContext() {
-  bool adopt_selected = true;
-  ExecutionContextRef exe_ctx_ref(GetSelectedTarget().get(), adopt_selected);
+  ExecutionContextRef exe_ctx_ref(&GetSelectedOrDummyTarget(),
+                                  /*adopt_selected=*/true);
   return ExecutionContext(exe_ctx_ref);
 }
 
diff --git a/lldb/source/Core/Statusline.cpp b/lldb/source/Core/Statusline.cpp
index 393d427241021..cfed40ac7fb2b 100644
--- a/lldb/source/Core/Statusline.cpp
+++ b/lldb/source/Core/Statusline.cpp
@@ -134,11 +134,7 @@ void Statusline::Redraw(bool update) {
   }
 
   ExecutionContext exe_ctx = m_debugger.GetSelectedExecutionContext();
-
-  // For colors and progress events, the format entity needs access to the
-  // debugger, which requires a target in the execution context.
-  if (!exe_ctx.HasTargetScope())
-    exe_ctx.SetTargetPtr(&m_debugger.GetSelectedOrDummyTarget());
+  assert(exe_ctx.HasTargetScope() && "format entity needs a target");
 
   SymbolContext symbol_ctx;
   if (ProcessSP process_sp = exe_ctx.GetProcessSP()) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants