1 //===-- SBInstruction.h -----------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SBInstruction_h_
10 #define LLDB_SBInstruction_h_
12 #include "lldb/API/SBData.h"
13 #include "lldb/API/SBDefines.h"
17 // There's a lot to be fixed here, but need to wait for underlying insn
18 // implementation to be revised & settle down first.
20 class InstructionImpl;
24 class LLDB_API SBInstruction {
28 SBInstruction(const SBInstruction &rhs);
30 const SBInstruction &operator=(const SBInstruction &rhs);
34 explicit operator bool() const;
38 SBAddress GetAddress();
40 const char *GetMnemonic(lldb::SBTarget target);
42 const char *GetOperands(lldb::SBTarget target);
44 const char *GetComment(lldb::SBTarget target);
46 lldb::SBData GetData(lldb::SBTarget target);
54 bool CanSetBreakpoint();
56 void Print(FILE *out);
58 bool GetDescription(lldb::SBStream &description);
60 bool EmulateWithFrame(lldb::SBFrame &frame, uint32_t evaluate_options);
62 bool DumpEmulation(const char *triple); // triple is to specify the
63 // architecture, e.g. 'armv6' or
66 bool TestEmulation(lldb::SBStream &output_stream, const char *test_file);
69 friend class SBInstructionList;
71 SBInstruction(const lldb::DisassemblerSP &disasm_sp,
72 const lldb::InstructionSP &inst_sp);
74 void SetOpaque(const lldb::DisassemblerSP &disasm_sp,
75 const lldb::InstructionSP &inst_sp);
77 lldb::InstructionSP GetOpaque();
80 std::shared_ptr<InstructionImpl> m_opaque_sp;
85 #endif // LLDB_SBInstruction_h_