54 const lldb::InstructionSP &inst_sp)
72 const lldb::InstructionSP &inst_sp)
76 : m_opaque_sp(rhs.m_opaque_sp) {
92 return this->
operator bool();
94SBInstruction::operator bool()
const {
97 return m_opaque_sp && m_opaque_sp->IsValid();
104 lldb::InstructionSP inst_sp(
GetOpaque());
105 if (inst_sp && inst_sp->GetAddress().IsValid())
113 lldb::InstructionSP inst_sp(
GetOpaque());
118 TargetSP target_sp(target.
GetSP());
119 std::unique_lock<std::recursive_mutex> lock;
121 lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
123 target_sp->CalculateExecutionContext(exe_ctx);
132 lldb::InstructionSP inst_sp(
GetOpaque());
137 TargetSP target_sp(target.
GetSP());
138 std::unique_lock<std::recursive_mutex> lock;
140 lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
142 target_sp->CalculateExecutionContext(exe_ctx);
151 lldb::InstructionSP inst_sp(
GetOpaque());
156 TargetSP target_sp(target.
GetSP());
157 std::unique_lock<std::recursive_mutex> lock;
159 lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
161 target_sp->CalculateExecutionContext(exe_ctx);
170 lldb::InstructionSP inst_sp(
GetOpaque());
173 TargetSP target_sp(target.
GetSP());
174 std::unique_lock<std::recursive_mutex> lock;
176 lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
178 target_sp->CalculateExecutionContext(exe_ctx);
181 return inst_sp->GetControlFlowKind(&exe_ctx);
189 lldb::InstructionSP inst_sp(
GetOpaque());
191 return inst_sp->GetOpcode().GetByteSize();
199 lldb::InstructionSP inst_sp(
GetOpaque());
202 if (inst_sp->GetData(*data_extractor_sp)) {
212 lldb::InstructionSP inst_sp(
GetOpaque());
214 return inst_sp->DoesBranch();
221 lldb::InstructionSP inst_sp(
GetOpaque());
223 return inst_sp->HasDelaySlot();
230 lldb::InstructionSP inst_sp(
GetOpaque());
232 return inst_sp->CanSetBreakpoint();
240 return lldb::InstructionSP();
244 const lldb::InstructionSP &inst_sp) {
245 m_opaque_sp = std::make_shared<InstructionImpl>(disasm_sp, inst_sp);
251 lldb::InstructionSP inst_sp(
GetOpaque());
254 const Address &addr = inst_sp->GetAddress();
257 module_sp->ResolveSymbolContextForAddress(addr, eSymbolContextEverything,
263 inst_sp->Dump(&s.
ref(), 0,
true,
false,
false,
264 nullptr, &sc,
nullptr, &format, 0);
272 FileSP out = std::make_shared<NativeFile>(outp,
false);
284 if (!out_sp || !out_sp->IsValid())
287 lldb::InstructionSP inst_sp(
GetOpaque());
290 const Address &addr = inst_sp->GetAddress();
293 module_sp->ResolveSymbolContextForAddress(addr, eSymbolContextEverything,
298 inst_sp->Dump(&out_stream, 0,
true,
false,
false,
299 nullptr, &sc,
nullptr, &format, 0);
307 lldb::InstructionSP inst_sp(
GetOpaque());
309 lldb::StackFrameSP frame_sp(frame.
GetFrameSP());
313 frame_sp->CalculateExecutionContext(exe_ctx);
317 return inst_sp->Emulate(
318 arch, evaluate_options, (
void *)frame_sp.get(),
331 lldb::InstructionSP inst_sp(
GetOpaque());
332 if (inst_sp && triple) {
333 return inst_sp->DumpEmulation(HostInfo::GetAugmentedArchSpec(triple));
339 const char *test_file) {
346 lldb::InstructionSP inst_sp(
GetOpaque());
348 return inst_sp->TestEmulation(output_stream.
get(), test_file);
#define LLDB_INSTRUMENT_VA(...)
lldb::InstructionSP GetSP() const
InstructionImpl(const lldb::DisassemblerSP &disasm_sp, const lldb::InstructionSP &inst_sp)
lldb::InstructionSP m_inst_sp
lldb::DisassemblerSP m_disasm_sp
void SetAddress(lldb::SBSection section, lldb::addr_t offset)
void SetOpaque(const lldb::DataExtractorSP &data_sp)
lldb::StackFrameSP GetFrameSP() const
void SetOpaque(const lldb::DisassemblerSP &disasm_sp, const lldb::InstructionSP &inst_sp)
std::shared_ptr< InstructionImpl > m_opaque_sp
const char * GetOperands(lldb::SBTarget target)
lldb::InstructionSP GetOpaque()
const char * GetComment(lldb::SBTarget target)
bool EmulateWithFrame(lldb::SBFrame &frame, uint32_t evaluate_options)
bool DumpEmulation(const char *triple)
lldb::InstructionControlFlowKind GetControlFlowKind(lldb::SBTarget target)
const SBInstruction & operator=(const SBInstruction &rhs)
bool TestEmulation(lldb::SBStream &output_stream, const char *test_file)
lldb::SBData GetData(lldb::SBTarget target)
bool GetDescription(lldb::SBStream &description)
const char * GetMnemonic(lldb::SBTarget target)
lldb_private::Stream & ref()
lldb_private::Stream * get()
lldb::TargetSP GetSP() const
A section + offset based address class.
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
An architecture specification class.
A uniqued constant string class.
const char * GetCString() const
Get the string value as a C string.
static size_t WriteMemoryFrame(EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, const void *dst, size_t length)
static size_t ReadMemoryFrame(EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, void *dst, size_t length)
static bool WriteRegisterFrame(EmulateInstruction *instruction, void *baton, const Context &context, const RegisterInfo *reg_info, const RegisterValue ®_value)
static bool ReadRegisterFrame(EmulateInstruction *instruction, void *baton, const RegisterInfo *reg_info, RegisterValue ®_value)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void SetProcessSP(const lldb::ProcessSP &process_sp)
Set accessor to set only the process shared pointer.
Target * GetTargetPtr() const
Returns a pointer to the target object.
Defines a symbol context baton that can be handed other debug core functions.
const ArchSpec & GetArchitecture() const
A class that represents a running process on the host machine.
InstructionControlFlowKind
Architecture-agnostic categorization of instructions for traversing the control flow of a trace.
@ eInstructionControlFlowKindUnknown
The instruction could not be classified.