SBInstructionList.h revision 355940
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
16namespace lldb {
17
18class LLDB_API SBInstructionList {
19public:
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  bool GetDescription(lldb::SBStream &description);
50
51  bool DumpEmulationForAllInstructions(const char *triple);
52
53protected:
54  friend class SBFunction;
55  friend class SBSymbol;
56  friend class SBTarget;
57
58  void SetDisassembler(const lldb::DisassemblerSP &opaque_sp);
59
60private:
61  lldb::DisassemblerSP m_opaque_sp;
62};
63
64} // namespace lldb
65
66#endif // LLDB_SBInstructionList_h_
67