]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/API/SBInstruction.h
MFV r317781:
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / API / SBInstruction.h
1 //===-- SBInstruction.h -----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLDB_SBInstruction_h_
11 #define LLDB_SBInstruction_h_
12
13 #include "lldb/API/SBData.h"
14 #include "lldb/API/SBDefines.h"
15
16 #include <stdio.h>
17
18 // There's a lot to be fixed here, but need to wait for underlying insn
19 // implementation
20 // to be revised & settle down first.
21
22 class InstructionImpl;
23
24 namespace lldb {
25
26 class LLDB_API SBInstruction {
27 public:
28   SBInstruction();
29
30   SBInstruction(const SBInstruction &rhs);
31
32   const SBInstruction &operator=(const SBInstruction &rhs);
33
34   ~SBInstruction();
35
36   bool IsValid();
37
38   SBAddress GetAddress();
39
40   lldb::AddressClass GetAddressClass();
41
42   const char *GetMnemonic(lldb::SBTarget target);
43
44   const char *GetOperands(lldb::SBTarget target);
45
46   const char *GetComment(lldb::SBTarget target);
47
48   lldb::SBData GetData(lldb::SBTarget target);
49
50   size_t GetByteSize();
51
52   bool DoesBranch();
53
54   bool HasDelaySlot();
55
56   void Print(FILE *out);
57
58   bool GetDescription(lldb::SBStream &description);
59
60   bool EmulateWithFrame(lldb::SBFrame &frame, uint32_t evaluate_options);
61
62   bool DumpEmulation(const char *triple); // triple is to specify the
63                                           // architecture, e.g. 'armv6' or
64                                           // 'armv7-apple-ios'
65
66   bool TestEmulation(lldb::SBStream &output_stream, const char *test_file);
67
68 protected:
69   friend class SBInstructionList;
70
71   SBInstruction(const lldb::DisassemblerSP &disasm_sp,
72                 const lldb::InstructionSP &inst_sp);
73
74   void SetOpaque(const lldb::DisassemblerSP &disasm_sp,
75                  const lldb::InstructionSP &inst_sp);
76
77   lldb::InstructionSP GetOpaque();
78
79 private:
80   std::shared_ptr<InstructionImpl> m_opaque_sp;
81 };
82
83 } // namespace lldb
84
85 #endif // LLDB_SBInstruction_h_