SBMemoryRegionInfo.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //===-- SBMemoryRegionInfo.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_SBMEMORYREGIONINFO_H
  9. #define LLDB_API_SBMEMORYREGIONINFO_H
  10. #include "lldb/API/SBData.h"
  11. #include "lldb/API/SBDefines.h"
  12. namespace lldb {
  13. class LLDB_API SBMemoryRegionInfo {
  14. public:
  15. SBMemoryRegionInfo();
  16. SBMemoryRegionInfo(const lldb::SBMemoryRegionInfo &rhs);
  17. ~SBMemoryRegionInfo();
  18. const lldb::SBMemoryRegionInfo &
  19. operator=(const lldb::SBMemoryRegionInfo &rhs);
  20. void Clear();
  21. /// Get the base address of this memory range.
  22. ///
  23. /// \return
  24. /// The base address of this memory range.
  25. lldb::addr_t GetRegionBase();
  26. /// Get the end address of this memory range.
  27. ///
  28. /// \return
  29. /// The base address of this memory range.
  30. lldb::addr_t GetRegionEnd();
  31. /// Check if this memory address is marked readable to the process.
  32. ///
  33. /// \return
  34. /// true if this memory address is marked readable
  35. bool IsReadable();
  36. /// Check if this memory address is marked writable to the process.
  37. ///
  38. /// \return
  39. /// true if this memory address is marked writable
  40. bool IsWritable();
  41. /// Check if this memory address is marked executable to the process.
  42. ///
  43. /// \return
  44. /// true if this memory address is marked executable
  45. bool IsExecutable();
  46. /// Check if this memory address is mapped into the process address
  47. /// space.
  48. ///
  49. /// \return
  50. /// true if this memory address is in the process address space.
  51. bool IsMapped();
  52. /// Returns the name of the memory region mapped at the given
  53. /// address.
  54. ///
  55. /// \return
  56. /// In case of memory mapped files it is the absolute path of
  57. /// the file otherwise it is a name associated with the memory
  58. /// region. If no name can be determined the returns nullptr.
  59. const char *GetName();
  60. bool operator==(const lldb::SBMemoryRegionInfo &rhs) const;
  61. bool operator!=(const lldb::SBMemoryRegionInfo &rhs) const;
  62. bool GetDescription(lldb::SBStream &description);
  63. private:
  64. friend class SBProcess;
  65. friend class SBMemoryRegionInfoList;
  66. lldb_private::MemoryRegionInfo &ref();
  67. const lldb_private::MemoryRegionInfo &ref() const;
  68. // Unused.
  69. SBMemoryRegionInfo(const lldb_private::MemoryRegionInfo *lldb_object_ptr);
  70. lldb::MemoryRegionInfoUP m_opaque_up;
  71. };
  72. } // namespace lldb
  73. #endif // LLDB_API_SBMEMORYREGIONINFO_H