1919#include " lldb/Target/ExecutionContext.h"
2020#include " lldb/Utility/Instrumentation.h"
2121#include " lldb/Utility/Stream.h"
22- #include < memory>
2322
2423using namespace lldb ;
2524using namespace lldb_private ;
@@ -144,11 +143,12 @@ bool SBInstructionList::GetDescription(lldb::SBStream &stream) {
144143bool SBInstructionList::GetDescription (lldb::SBStream &stream,
145144 lldb::SBExecutionContext &exe_ctx) {
146145 LLDB_INSTRUMENT_VA (this , stream);
147- return GetDescription (stream.ref (), &exe_ctx);
146+ ExecutionContext exe_ctx_wrapper (exe_ctx.get ());
147+ return GetDescription (stream.ref (), &exe_ctx_wrapper);
148148}
149149
150- bool SBInstructionList::GetDescription (Stream &sref,
151- lldb::SBExecutionContext *exe_ctx) {
150+ bool SBInstructionList::GetDescription (
151+ Stream &sref, lldb_private::ExecutionContext *exe_ctx) {
152152
153153 if (m_opaque_sp) {
154154 size_t num_instructions = GetSize ();
@@ -162,11 +162,6 @@ bool SBInstructionList::GetDescription(Stream &sref,
162162 SymbolContext sc;
163163 SymbolContext prev_sc;
164164
165- std::shared_ptr<ExecutionContext> exe_ctx_ptr;
166- if (nullptr != exe_ctx) {
167- exe_ctx_ptr = std::make_shared<ExecutionContext>(exe_ctx->get ());
168- }
169-
170165 // Expected address of the next instruction. Used to print an empty line
171166 // for non-contiguous blocks of insns.
172167 std::optional<Address> next_addr;
@@ -187,8 +182,8 @@ bool SBInstructionList::GetDescription(Stream &sref,
187182 if (next_addr && *next_addr != addr)
188183 sref.EOL ();
189184 inst->Dump (&sref, max_opcode_byte_size, true , false ,
190- /* show_control_flow_kind=*/ false , exe_ctx_ptr. get () , &sc,
191- &prev_sc, & format, 0 );
185+ /* show_control_flow_kind=*/ false , exe_ctx , &sc, &prev_sc ,
186+ &format, 0 );
192187 sref.EOL ();
193188 next_addr = addr;
194189 next_addr->Slide (inst->GetOpcode ().GetByteSize ());
0 commit comments