]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/API/SBInstruction.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302418, and update
[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   bool CanSetBreakpoint();
57
58   void Print(FILE *out);
59
60   bool GetDescription(lldb::SBStream &description);
61
62   bool EmulateWithFrame(lldb::SBFrame &frame, uint32_t evaluate_options);
63
64   bool DumpEmulation(const char *triple); // triple is to specify the
65                                           // architecture, e.g. 'armv6' or
66                                           // 'armv7-apple-ios'
67
68   bool TestEmulation(lldb::SBStream &output_stream, const char *test_file);
69
70 protected:
71   friend class SBInstructionList;
72
73   SBInstruction(const lldb::DisassemblerSP &disasm_sp,
74                 const lldb::InstructionSP &inst_sp);
75
76   void SetOpaque(const lldb::DisassemblerSP &disasm_sp,
77                  const lldb::InstructionSP &inst_sp);
78
79   lldb::InstructionSP GetOpaque();
80
81 private:
82   std::shared_ptr<InstructionImpl> m_opaque_sp;
83 };
84
85 } // namespace lldb
86
87 #endif // LLDB_SBInstruction_h_