1 //===-- SBInstructionList.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_SBInstructionList_h_
10 #define LLDB_SBInstructionList_h_
11 
12 #include "lldb/API/SBDefines.h"
13 
14 #include <stdio.h>
15 
16 namespace lldb {
17 
18 class LLDB_API SBInstructionList {
19 public:
20   SBInstructionList();
21 
22   SBInstructionList(const SBInstructionList &rhs);
23 
24   const SBInstructionList &operator=(const SBInstructionList &rhs);
25 
26   ~SBInstructionList();
27 
28   explicit operator bool() const;
29 
30   bool IsValid() const;
31 
32   size_t GetSize();
33 
34   lldb::SBInstruction GetInstructionAtIndex(uint32_t idx);
35 
36   // Returns the number of instructions between the start and end address. If
37   // canSetBreakpoint is true then the count will be the number of
38   // instructions on which a breakpoint can be set.
39   size_t GetInstructionsCount(const SBAddress &start,
40                               const SBAddress &end,
41                               bool canSetBreakpoint = false);
42 
43   void Clear();
44 
45   void AppendInstruction(lldb::SBInstruction inst);
46 
47   void Print(FILE *out);
48 
49   void Print(SBFile out);
50 
51   void Print(FileSP out);
52 
53   bool GetDescription(lldb::SBStream &description);
54 
55   bool DumpEmulationForAllInstructions(const char *triple);
56 
57 protected:
58   friend class SBFunction;
59   friend class SBSymbol;
60   friend class SBTarget;
61 
62   void SetDisassembler(const lldb::DisassemblerSP &opaque_sp);
63   bool GetDescription(lldb_private::Stream &description);
64 
65 
66 private:
67   lldb::DisassemblerSP m_opaque_sp;
68 };
69 
70 } // namespace lldb
71 
72 #endif // LLDB_SBInstructionList_h_
73