diff --git a/lldb/include/lldb/Target/MemoryRegionInfo.h b/lldb/include/lldb/Target/MemoryRegionInfo.h --- a/lldb/include/lldb/Target/MemoryRegionInfo.h +++ b/lldb/include/lldb/Target/MemoryRegionInfo.h @@ -107,13 +107,13 @@ /// Get the target system's VM page size in bytes. /// \return /// 0 is returned if this information is unavailable. - int GetPageSize() { return m_pagesize; } + int GetPageSize() const { return m_pagesize; } /// Get a vector of target VM pages that are dirty -- that have been /// modified -- within this memory region. This is an Optional return /// value; it will only be available if the remote stub was able to /// detail this. - llvm::Optional> &GetDirtyPageList() { + const llvm::Optional> &GetDirtyPageList() const { return m_dirty_pages; } diff --git a/lldb/source/API/SBMemoryRegionInfo.cpp b/lldb/source/API/SBMemoryRegionInfo.cpp --- a/lldb/source/API/SBMemoryRegionInfo.cpp +++ b/lldb/source/API/SBMemoryRegionInfo.cpp @@ -133,7 +133,7 @@ LLDB_INSTRUMENT_VA(this); uint32_t num_dirty_pages = 0; - llvm::Optional> dirty_page_list = + const llvm::Optional> &dirty_page_list = m_opaque_up->GetDirtyPageList(); if (dirty_page_list.hasValue()) num_dirty_pages = dirty_page_list.getValue().size();