[Lldb-commits] [lldb] [nfc][lldb] Move FastSearch from CommandObjectMemoryFind to Process (PR #93688)

via lldb-commits lldb-commits at lists.llvm.org
Wed May 29 07:08:03 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff bbca20f0b1ab7c6ea36a84e88a6abb07f94ca80b b6ac1147a441d774c8a5ea4c2de620b72be151e2 -- lldb/include/lldb/Target/Process.h lldb/source/Commands/CommandObjectMemory.cpp lldb/source/Target/Process.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index f293d1e784..eec337c15f 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -2682,7 +2682,7 @@ void PruneThreadPlans();
   ///
   /// \return The address where the pattern was found or LLDB_INVALID_ADDRESS if
   /// not found.
-  lldb::addr_t FindInMemory(lldb::addr_t low, lldb::addr_t high, 
+  lldb::addr_t FindInMemory(lldb::addr_t low, lldb::addr_t high,
                             const uint8_t *buf, size_t size);
 
 protected:
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 2e0a96b07b..1e321f8bde 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -115,7 +115,7 @@ public:
 class ProcessMemoryIterator {
 public:
   ProcessMemoryIterator(Process &process, lldb::addr_t base)
-      : m_process(process), m_base_addr(base) { }
+      : m_process(process), m_base_addr(base) {}
 
   bool IsValid() { return m_is_valid; }
 
@@ -125,8 +125,7 @@ public:
 
     uint8_t retval = 0;
     Status error;
-    if (0 ==
-        m_process.ReadMemory(m_base_addr + offset, &retval, 1, error)) {
+    if (0 == m_process.ReadMemory(m_base_addr + offset, &retval, 1, error)) {
       m_is_valid = false;
       return 0;
     }
@@ -134,10 +133,10 @@ public:
     return retval;
   }
 
-  private:
-    Process &m_process;
-    const lldb::addr_t m_base_addr;
-    bool m_is_valid = true;
+private:
+  Process &m_process;
+  const lldb::addr_t m_base_addr;
+  bool m_is_valid = true;
 };
 
 static constexpr OptionEnumValueElement g_follow_fork_mode_values[] = {

``````````

</details>


https://github.com/llvm/llvm-project/pull/93688


More information about the lldb-commits mailing list