SBInstructionList.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. #ifndef LLDB_API_SBINSTRUCTIONLIST_H
  9. #define LLDB_API_SBINSTRUCTIONLIST_H
  10. #include "lldb/API/SBDefines.h"
  11. #include <cstdio>
  12. namespace lldb {
  13. class LLDB_API SBInstructionList {
  14. public:
  15. SBInstructionList();
  16. SBInstructionList(const SBInstructionList &rhs);
  17. const SBInstructionList &operator=(const SBInstructionList &rhs);
  18. ~SBInstructionList();
  19. explicit operator bool() const;
  20. bool IsValid() const;
  21. size_t GetSize();
  22. lldb::SBInstruction GetInstructionAtIndex(uint32_t idx);
  23. // Returns the number of instructions between the start and end address. If
  24. // canSetBreakpoint is true then the count will be the number of
  25. // instructions on which a breakpoint can be set.
  26. size_t GetInstructionsCount(const SBAddress &start,
  27. const SBAddress &end,
  28. bool canSetBreakpoint = false);
  29. void Clear();
  30. void AppendInstruction(lldb::SBInstruction inst);
  31. void Print(FILE *out);
  32. void Print(SBFile out);
  33. void Print(FileSP out);
  34. bool GetDescription(lldb::SBStream &description);
  35. bool DumpEmulationForAllInstructions(const char *triple);
  36. protected:
  37. friend class SBFunction;
  38. friend class SBSymbol;
  39. friend class SBTarget;
  40. void SetDisassembler(const lldb::DisassemblerSP &opaque_sp);
  41. bool GetDescription(lldb_private::Stream &description);
  42. private:
  43. lldb::DisassemblerSP m_opaque_sp;
  44. };
  45. } // namespace lldb
  46. #endif // LLDB_API_SBINSTRUCTIONLIST_H