]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lldb/include/lldb/API/SBInstruction.h
Move all sources from the llvm project into contrib/llvm-project.
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lldb / include / lldb / API / SBInstruction.h
1 //===-- SBInstruction.h -----------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLDB_SBInstruction_h_
10 #define LLDB_SBInstruction_h_
11
12 #include "lldb/API/SBData.h"
13 #include "lldb/API/SBDefines.h"
14
15 #include <stdio.h>
16
17 // There's a lot to be fixed here, but need to wait for underlying insn
18 // implementation to be revised & settle down first.
19
20 class InstructionImpl;
21
22 namespace lldb {
23
24 class LLDB_API SBInstruction {
25 public:
26   SBInstruction();
27
28   SBInstruction(const SBInstruction &rhs);
29
30   const SBInstruction &operator=(const SBInstruction &rhs);
31
32   ~SBInstruction();
33
34   explicit operator bool() const;
35
36   bool IsValid();
37
38   SBAddress GetAddress();
39
40   const char *GetMnemonic(lldb::SBTarget target);
41
42   const char *GetOperands(lldb::SBTarget target);
43
44   const char *GetComment(lldb::SBTarget target);
45
46   lldb::SBData GetData(lldb::SBTarget target);
47
48   size_t GetByteSize();
49
50   bool DoesBranch();
51
52   bool HasDelaySlot();
53
54   bool CanSetBreakpoint();
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_