[Lldb-commits] [lldb] Revert commits that add `TestFind(Ranges)InMemory.py` (PR #96560)

2024-06-24 Thread Chelsea Cassanova via lldb-commits

https://github.com/chelcassanova closed 
https://github.com/llvm/llvm-project/pull/96560
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Revert commits that add `TestFind(Ranges)InMemory.py` (PR #96560)

2024-06-24 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Chelsea Cassanova (chelcassanova)


Changes

Reverting to unblock macOS buildbots which are currently failing on these 
tests. https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/6377/

---

Patch is 28.12 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/96560.diff


11 Files Affected:

- (modified) lldb/bindings/python/python-typemaps.swig (+1-2) 
- (modified) lldb/include/lldb/API/SBProcess.h (-10) 
- (modified) lldb/include/lldb/Core/AddressRangeListImpl.h (-4) 
- (modified) lldb/include/lldb/Target/Process.h (-14) 
- (modified) lldb/source/API/SBProcess.cpp (+5-53) 
- (modified) lldb/source/Target/Process.cpp (-123) 
- (removed) lldb/test/API/python_api/find_in_memory/Makefile (-3) 
- (removed) lldb/test/API/python_api/find_in_memory/TestFindInMemory.py (-131) 
- (removed) lldb/test/API/python_api/find_in_memory/TestFindRangesInMemory.py 
(-221) 
- (removed) lldb/test/API/python_api/find_in_memory/address_ranges_helper.py 
(-72) 
- (removed) lldb/test/API/python_api/find_in_memory/main.cpp (-27) 


``diff
diff --git a/lldb/bindings/python/python-typemaps.swig 
b/lldb/bindings/python/python-typemaps.swig
index f8c33e15c03e6..c39594c7df041 100644
--- a/lldb/bindings/python/python-typemaps.swig
+++ b/lldb/bindings/python/python-typemaps.swig
@@ -257,8 +257,7 @@ AND call SWIG_fail at the same time, because it will result 
in a double free.
 }
 // For SBProcess::WriteMemory, SBTarget::GetInstructions and 
SBDebugger::DispatchInput.
 %typemap(in) (const void *buf, size_t size),
- (const void *data, size_t data_len),
- (const void *buf, uint64_t size) {
+ (const void *data, size_t data_len) {
   if (PythonString::Check($input)) {
 PythonString str(PyRefType::Borrowed, $input);
 $1 = (void *)str.GetString().data();
diff --git a/lldb/include/lldb/API/SBProcess.h 
b/lldb/include/lldb/API/SBProcess.h
index a6ab7ae759918..f1b5d1fb92ce2 100644
--- a/lldb/include/lldb/API/SBProcess.h
+++ b/lldb/include/lldb/API/SBProcess.h
@@ -209,16 +209,6 @@ class LLDB_API SBProcess {
 
   lldb::addr_t ReadPointerFromMemory(addr_t addr, lldb::SBError );
 
-  lldb::SBAddressRangeList FindRangesInMemory(const void *buf, uint64_t size,
-  const SBAddressRangeList ,
-  uint32_t alignment,
-  uint32_t max_matches,
-  SBError );
-
-  lldb::addr_t FindInMemory(const void *buf, uint64_t size,
-const SBAddressRange , uint32_t alignment,
-SBError );
-
   // Events
   static lldb::StateType GetStateFromEvent(const lldb::SBEvent );
 
diff --git a/lldb/include/lldb/Core/AddressRangeListImpl.h 
b/lldb/include/lldb/Core/AddressRangeListImpl.h
index 6742e6ead87de..46ebfe73d4d92 100644
--- a/lldb/include/lldb/Core/AddressRangeListImpl.h
+++ b/lldb/include/lldb/Core/AddressRangeListImpl.h
@@ -13,9 +13,7 @@
 #include 
 
 namespace lldb {
-class SBAddressRangeList;
 class SBBlock;
-class SBProcess;
 }
 
 namespace lldb_private {
@@ -41,9 +39,7 @@ class AddressRangeListImpl {
   lldb_private::AddressRange GetAddressRangeAtIndex(size_t index);
 
 private:
-  friend class lldb::SBAddressRangeList;
   friend class lldb::SBBlock;
-  friend class lldb::SBProcess;
 
   AddressRanges ();
 
diff --git a/lldb/include/lldb/Target/Process.h 
b/lldb/include/lldb/Target/Process.h
index ceaf547ebddaf..eec337c15f7ed 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -2685,15 +2685,6 @@ void PruneThreadPlans();
   lldb::addr_t FindInMemory(lldb::addr_t low, lldb::addr_t high,
 const uint8_t *buf, size_t size);
 
-  AddressRanges FindRangesInMemory(const uint8_t *buf, uint64_t size,
-   const AddressRanges ,
-   size_t alignment, size_t max_matches,
-   Status );
-
-  lldb::addr_t FindInMemory(const uint8_t *buf, uint64_t size,
-const AddressRange , size_t alignment,
-Status );
-
 protected:
   friend class Trace;
 
@@ -2809,11 +2800,6 @@ void PruneThreadPlans();
   virtual size_t DoReadMemory(lldb::addr_t vm_addr, void *buf, size_t size,
   Status ) = 0;
 
-  virtual void DoFindInMemory(lldb::addr_t start_addr, lldb::addr_t end_addr,
-  const uint8_t *buf, size_t size,
-  AddressRanges , size_t alignment,
-  size_t max_matches);
-
   /// DoGetMemoryRegionInfo is called by GetMemoryRegionInfo after it has
   /// removed non address bits from load_addr. Override this method in
   /// subclasses of Process.
diff --git a/lldb/source/API/SBProcess.cpp 

[Lldb-commits] [lldb] Revert commits that add `TestFind(Ranges)InMemory.py` (PR #96560)

2024-06-24 Thread Chelsea Cassanova via lldb-commits

https://github.com/chelcassanova created 
https://github.com/llvm/llvm-project/pull/96560

Reverting to unblock macOS buildbots which are currently failing on these 
tests. https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/6377/

>From 22127178761968b01be207a1c83c7048dc3ec47d Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova 
Date: Mon, 24 Jun 2024 14:17:09 -0700
Subject: [PATCH 1/2] Revert "[lldb] Fix failing TestFind(Ranges)InMemory.py
 tests. (#96511)"

This reverts commit 33a9c57b89c3ea901a057c3fcc9c9160eaf5a625. Alongside
10bd5ad this is being reverted as these commits are blocking the macOS
buildbots: 
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/6375/
---
 lldb/test/API/python_api/find_in_memory/address_ranges_helper.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lldb/test/API/python_api/find_in_memory/address_ranges_helper.py 
b/lldb/test/API/python_api/find_in_memory/address_ranges_helper.py
index 2c11fba80766f..0544100f97b29 100644
--- a/lldb/test/API/python_api/find_in_memory/address_ranges_helper.py
+++ b/lldb/test/API/python_api/find_in_memory/address_ranges_helper.py
@@ -35,6 +35,7 @@ def GetRangeFromAddrValue(test_base, addr):
 )
 
 test_base.assertTrue(region.IsReadable())
+test_base.assertFalse(region.IsExecutable())
 
 address_start = lldb.SBAddress(region.GetRegionBase(), test_base.target)
 stack_size = region.GetRegionEnd() - region.GetRegionBase()

>From 10b926cb193292252bc8df6d0ed8345dc73c30e5 Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova 
Date: Mon, 24 Jun 2024 14:18:51 -0700
Subject: [PATCH 2/2] Revert "[lldb][API] Add Find(Ranges)InMemory() to Process
 SB API (#95007)"

This reverts commit 10bd5ad0a133fe73ffc1b05e63bc3fb2d56ba79c. Alongside
33a9c57 this commit is being reverted to unblock the macOS buildbots.
---
 lldb/bindings/python/python-typemaps.swig |   3 +-
 lldb/include/lldb/API/SBProcess.h |  10 -
 lldb/include/lldb/Core/AddressRangeListImpl.h |   4 -
 lldb/include/lldb/Target/Process.h|  14 --
 lldb/source/API/SBProcess.cpp |  58 +
 lldb/source/Target/Process.cpp| 123 --
 .../API/python_api/find_in_memory/Makefile|   3 -
 .../find_in_memory/TestFindInMemory.py| 131 ---
 .../find_in_memory/TestFindRangesInMemory.py  | 221 --
 .../find_in_memory/address_ranges_helper.py   |  73 --
 .../API/python_api/find_in_memory/main.cpp|  27 ---
 11 files changed, 6 insertions(+), 661 deletions(-)
 delete mode 100644 lldb/test/API/python_api/find_in_memory/Makefile
 delete mode 100644 lldb/test/API/python_api/find_in_memory/TestFindInMemory.py
 delete mode 100644 
lldb/test/API/python_api/find_in_memory/TestFindRangesInMemory.py
 delete mode 100644 
lldb/test/API/python_api/find_in_memory/address_ranges_helper.py
 delete mode 100644 lldb/test/API/python_api/find_in_memory/main.cpp

diff --git a/lldb/bindings/python/python-typemaps.swig 
b/lldb/bindings/python/python-typemaps.swig
index f8c33e15c03e6..c39594c7df041 100644
--- a/lldb/bindings/python/python-typemaps.swig
+++ b/lldb/bindings/python/python-typemaps.swig
@@ -257,8 +257,7 @@ AND call SWIG_fail at the same time, because it will result 
in a double free.
 }
 // For SBProcess::WriteMemory, SBTarget::GetInstructions and 
SBDebugger::DispatchInput.
 %typemap(in) (const void *buf, size_t size),
- (const void *data, size_t data_len),
- (const void *buf, uint64_t size) {
+ (const void *data, size_t data_len) {
   if (PythonString::Check($input)) {
 PythonString str(PyRefType::Borrowed, $input);
 $1 = (void *)str.GetString().data();
diff --git a/lldb/include/lldb/API/SBProcess.h 
b/lldb/include/lldb/API/SBProcess.h
index a6ab7ae759918..f1b5d1fb92ce2 100644
--- a/lldb/include/lldb/API/SBProcess.h
+++ b/lldb/include/lldb/API/SBProcess.h
@@ -209,16 +209,6 @@ class LLDB_API SBProcess {
 
   lldb::addr_t ReadPointerFromMemory(addr_t addr, lldb::SBError );
 
-  lldb::SBAddressRangeList FindRangesInMemory(const void *buf, uint64_t size,
-  const SBAddressRangeList ,
-  uint32_t alignment,
-  uint32_t max_matches,
-  SBError );
-
-  lldb::addr_t FindInMemory(const void *buf, uint64_t size,
-const SBAddressRange , uint32_t alignment,
-SBError );
-
   // Events
   static lldb::StateType GetStateFromEvent(const lldb::SBEvent );
 
diff --git a/lldb/include/lldb/Core/AddressRangeListImpl.h 
b/lldb/include/lldb/Core/AddressRangeListImpl.h
index 6742e6ead87de..46ebfe73d4d92 100644
--- a/lldb/include/lldb/Core/AddressRangeListImpl.h
+++ b/lldb/include/lldb/Core/AddressRangeListImpl.h
@@ -13,9 +13,7 @@
 #include 
 
 namespace lldb {
-class SBAddressRangeList;
 class SBBlock;
-class SBProcess;
 }