return nullptr;
}
+lldb::InstructionControlFlowKind SBInstruction::GetControlFlowKind(lldb::SBTarget target) {
+ LLDB_INSTRUMENT_VA(this, target);
+
+ lldb::InstructionSP inst_sp(GetOpaque());
+ if (inst_sp) {
+ ExecutionContext exe_ctx;
+ TargetSP target_sp(target.GetSP());
+ std::unique_lock<std::recursive_mutex> lock;
+ if (target_sp) {
+ lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
+
+ target_sp->CalculateExecutionContext(exe_ctx);
+ exe_ctx.SetProcessSP(target_sp->GetProcessSP());
+ }
+ return inst_sp->GetControlFlowKind(&exe_ctx);
+ }
+ return lldb::eInstructionControlFlowKindUnknown;
+}
+
size_t SBInstruction::GetByteSize() {
LLDB_INSTRUMENT_VA(this);
self.assertEqual(inst.GetMnemonic(target), "move")
self.assertEqual(inst.GetOperands(target),
'$' + "fp, " + '$' + "sp")
+ self.assertEqual(inst.GetControlFlowKind(target),
+ lldb.eInstructionControlFlowKindUnknown)
elif re.match("powerpc64le", arch):
self.assertEqual(inst.GetMnemonic(target), "li")
self.assertEqual(inst.GetOperands(target), "4, 0")
+ self.assertEqual(inst.GetControlFlowKind(target),
+ lldb.eInstructionControlFlowKindUnknown)
elif arch in ("aarch64", "arm64"):
self.assertEqual(inst.GetMnemonic(target), "mov")
self.assertEqual(inst.GetOperands(target), "w0, #0x63")
+ self.assertEqual(inst.GetControlFlowKind(target),
+ lldb.eInstructionControlFlowKindUnknown)
elif arch == "arm":
self.assertEqual(inst.GetMnemonic(target), "mov")
self.assertEqual(inst.GetOperands(target), "r3, #99")
+ self.assertEqual(inst.GetControlFlowKind(target),
+ lldb.eInstructionControlFlowKindUnknown)
else:
self.assertEqual(inst.GetMnemonic(target), "movq")
self.assertEqual(inst.GetOperands(target),
'%' + "rsp, " + '%' + "rbp")
+ self.assertEqual(inst.GetControlFlowKind(target),
+ lldb.eInstructionControlFlowKindOther)