Skip to content

Commit 1b9e8b7

Browse files
committed
[lldb] Store the dummy target in the selected exeuction context
1 parent 6932080 commit 1b9e8b7

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

lldb/source/Core/Debugger.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,8 +1221,8 @@ void Debugger::RedrawStatusline(bool update) {
12211221
}
12221222

12231223
ExecutionContext Debugger::GetSelectedExecutionContext() {
1224-
bool adopt_selected = true;
1225-
ExecutionContextRef exe_ctx_ref(GetSelectedTarget().get(), adopt_selected);
1224+
ExecutionContextRef exe_ctx_ref(&GetSelectedOrDummyTarget(),
1225+
/*adopt_selected=*/true);
12261226
return ExecutionContext(exe_ctx_ref);
12271227
}
12281228

lldb/source/Core/Statusline.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,7 @@ void Statusline::Redraw(bool update) {
134134
}
135135

136136
ExecutionContext exe_ctx = m_debugger.GetSelectedExecutionContext();
137-
138-
// For colors and progress events, the format entity needs access to the
139-
// debugger, which requires a target in the execution context.
140-
if (!exe_ctx.HasTargetScope())
141-
exe_ctx.SetTargetPtr(&m_debugger.GetSelectedOrDummyTarget());
137+
assert(exe_ctx.HasTargetScope() && "format entity needs a target");
142138

143139
SymbolContext symbol_ctx;
144140
if (ProcessSP process_sp = exe_ctx.GetProcessSP()) {

lldb/source/Interpreter/CommandObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ bool CommandObject::CheckRequirements(CommandReturnObject &result) {
147147
// we don't want any CommandObject instances to keep any of these objects
148148
// around longer than for a single command. Every command should call
149149
// CommandObject::Cleanup() after it has completed.
150-
assert(!m_exe_ctx.GetTargetPtr());
150+
assert(!m_exe_ctx.GetTargetPtr() || m_exe_ctx.GetTargetRef().IsDummyTarget());
151151
assert(!m_exe_ctx.GetProcessPtr());
152152
assert(!m_exe_ctx.GetThreadPtr());
153153
assert(!m_exe_ctx.GetFramePtr());

0 commit comments

Comments
 (0)