-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[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
base: main
Are you sure you want to change the base?
Conversation
@llvm/pr-subscribers-lldb Author: Jonas Devlieghere (JDevlieghere) ChangesFull diff: https://github.com/llvm/llvm-project/pull/149615.diff 2 Files Affected:
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()) {
|
2f65e10
to
7701787
Compare
This seems like a good idea. No reason for everybody to have to independently fall back to the dummy target. |
7701787
to
1b9e8b7
Compare
1b9e8b7
to
0737726
Compare
This seems to break a bunch of assumptions. I still think it's the right thing to do, but it's not on the critical path so I'll keep this in my back pocket until I have the bandwidth to fix the test failures:
|
No description provided.