]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/API/SBInstruction.h
Merge ^/head r308842 through r308867.
[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/SBDefines.h"
14 #include "lldb/API/SBData.h"
15
16 #include <stdio.h>
17
18 // There's a lot to be fixed here, but need to wait for underlying insn implementation
19 // to be revised & settle down first.
20
21 class InstructionImpl;
22
23 namespace lldb {
24
25 class LLDB_API SBInstruction
26 {
27 public:
28
29     SBInstruction ();
30
31     SBInstruction (const SBInstruction &rhs);
32     
33     const SBInstruction &
34     operator = (const SBInstruction &rhs);
35
36     ~SBInstruction ();
37
38     bool
39     IsValid();
40
41     SBAddress
42     GetAddress();
43     
44     lldb::AddressClass
45     GetAddressClass ();
46     
47     const char *
48     GetMnemonic (lldb::SBTarget target);
49
50     const char *
51     GetOperands (lldb::SBTarget target);
52     
53     const char *
54     GetComment (lldb::SBTarget target);
55
56     lldb::SBData
57     GetData (lldb::SBTarget target);
58
59     size_t
60     GetByteSize ();
61
62     bool
63     DoesBranch ();
64
65     bool
66     HasDelaySlot ();
67
68     void
69     Print (FILE *out);
70
71     bool
72     GetDescription (lldb::SBStream &description);
73
74     bool
75     EmulateWithFrame (lldb::SBFrame &frame, uint32_t evaluate_options);
76
77     bool
78     DumpEmulation (const char * triple); // triple is to specify the architecture, e.g. 'armv6' or 'armv7-apple-ios'
79     
80     bool
81     TestEmulation (lldb::SBStream &output_stream, const char *test_file);
82
83 protected:
84     friend class SBInstructionList;
85
86     SBInstruction(const lldb::DisassemblerSP &disasm_sp, const lldb::InstructionSP &inst_sp);
87
88     void
89     SetOpaque(const lldb::DisassemblerSP &disasm_sp, const lldb::InstructionSP& inst_sp);
90
91     lldb::InstructionSP
92     GetOpaque();
93
94 private:
95
96     std::shared_ptr<InstructionImpl> m_opaque_sp;
97 };
98
99
100 } // namespace lldb
101
102 #endif // LLDB_SBInstruction_h_