From 65bc8ba1a2d434ba72f6f476bfd4a9ae69cb16b2 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Mon, 16 Aug 2021 13:40:07 -0700 Subject: [PATCH] Correctly update reproducer hooks for SB API I added In 9ea6dd5cfac0b233fbb148c1e2d0f81f816737c8 / https://reviews.llvm.org/D88387 where I added skinny corefile creation, I added new SB API and tried to manually update the hooks for the reproducers. I missed a spot, and I should have used lldb-instr to update the instrumentation automatically. --- lldb/source/API/SBMemoryRegionInfo.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lldb/source/API/SBMemoryRegionInfo.cpp b/lldb/source/API/SBMemoryRegionInfo.cpp index ab74d55..d924a31 100644 --- a/lldb/source/API/SBMemoryRegionInfo.cpp +++ b/lldb/source/API/SBMemoryRegionInfo.cpp @@ -116,14 +116,14 @@ const char *SBMemoryRegionInfo::GetName() { return m_opaque_up->GetName().AsCString(); } -bool SBMemoryRegionInfo::HasDirtyMemoryPageList() { - LLDB_RECORD_METHOD_NO_ARGS(bool, SBMemoryRegionInfo, HasDirtyMemoryPageList); +bool SBMemoryRegionInfo::HasDirtyMemoryPageList() {LLDB_RECORD_METHOD_NO_ARGS(bool, SBMemoryRegionInfo, HasDirtyMemoryPageList); + return m_opaque_up->GetDirtyPageList().hasValue(); } -uint32_t SBMemoryRegionInfo::GetNumDirtyPages() { - LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBMemoryRegionInfo, GetNumDirtyPages); +uint32_t SBMemoryRegionInfo::GetNumDirtyPages() {LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBMemoryRegionInfo, GetNumDirtyPages); + uint32_t num_dirty_pages = 0; llvm::Optional> dirty_page_list = @@ -134,9 +134,8 @@ uint32_t SBMemoryRegionInfo::GetNumDirtyPages() { return num_dirty_pages; } -addr_t SBMemoryRegionInfo::GetDirtyPageAddressAtIndex(uint32_t idx) { - LLDB_RECORD_METHOD(addr_t, SBMemoryRegionInfo, GetDirtyPageAddressAtIndex, - (uint32_t), idx); +addr_t SBMemoryRegionInfo::GetDirtyPageAddressAtIndex(uint32_t idx) {LLDB_RECORD_METHOD(lldb::addr_t, SBMemoryRegionInfo, GetDirtyPageAddressAtIndex, (uint32_t), idx); + addr_t dirty_page_addr = LLDB_INVALID_ADDRESS; const llvm::Optional> &dirty_page_list = @@ -147,8 +146,9 @@ addr_t SBMemoryRegionInfo::GetDirtyPageAddressAtIndex(uint32_t idx) { return dirty_page_addr; } -int SBMemoryRegionInfo::GetPageSize() { - LLDB_RECORD_METHOD_NO_ARGS(int, SBMemoryRegionInfo, GetPageSize); +int SBMemoryRegionInfo::GetPageSize() {LLDB_RECORD_METHOD_NO_ARGS(int, SBMemoryRegionInfo, GetPageSize); + + return m_opaque_up->GetPageSize(); } @@ -196,6 +196,10 @@ void RegisterMethods(Registry &R) { LLDB_REGISTER_METHOD(const char *, SBMemoryRegionInfo, GetName, ()); LLDB_REGISTER_METHOD(bool, SBMemoryRegionInfo, GetDescription, (lldb::SBStream &)); + LLDB_REGISTER_METHOD(bool, SBMemoryRegionInfo, HasDirtyMemoryPageList, ()); + LLDB_REGISTER_METHOD(uint32_t, SBMemoryRegionInfo, GetNumDirtyPages, ()); + LLDB_REGISTER_METHOD(lldb::addr_t, SBMemoryRegionInfo, GetDirtyPageAddressAtIndex, (uint32_t)); + LLDB_REGISTER_METHOD(int, SBMemoryRegionInfo, GetPageSize, ()); } } -- 2.7.4