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();
105 if (inst_sp && inst_sp->GetAddress().IsValid())
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);
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);
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);
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);
191 return inst_sp->GetOpcode().GetByteSize();
202 if (inst_sp->GetData(*data_extractor_sp)) {
214 return inst_sp->DoesBranch();
223 return inst_sp->HasDelaySlot();
232 return inst_sp->CanSetBreakpoint();
245 m_opaque_sp = std::make_shared<InstructionImpl>(disasm_sp, inst_sp);
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())
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);
304 uint32_t evaluate_options) {
313 frame_sp->CalculateExecutionContext(exe_ctx);
317 return inst_sp->Emulate(
318 arch, evaluate_options, (
void *)frame_sp.get(),
332 if (inst_sp && triple) {
333 return inst_sp->DumpEmulation(HostInfo::GetAugmentedArchSpec(triple));
339 const char *test_file) {
348 return inst_sp->TestEmulation(output_stream.
ref(), 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::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.
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::Instruction > InstructionSP
std::shared_ptr< lldb_private::Disassembler > DisassemblerSP
InstructionControlFlowKind
Architecture-agnostic categorization of instructions for traversing the control flow of a trace.
@ eInstructionControlFlowKindUnknown
The instruction could not be classified.
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::File > FileSP
std::shared_ptr< lldb_private::DataExtractor > DataExtractorSP
std::shared_ptr< lldb_private::Module > ModuleSP