[Lldb-commits] [lldb] [lldb] Fix handling of unaligned results in DoFindInMemory (PR #189950)
via lldb-commits
lldb-commits at lists.llvm.org
Wed Apr 1 05:56:25 PDT 2026
https://github.com/mentha created https://github.com/llvm/llvm-project/pull/189950
While encountering an unaligned result in DoFindInMemory, instead of skipping already searched memory, the function incorrectly restart the search from almost the beginning of the search range.
>From 29cd5097556a1c3f00407508327b0c651155f187 Mon Sep 17 00:00:00 2001
From: Jiang XueQian <jiangxueqian at gmail.com>
Date: Wed, 1 Apr 2026 18:58:50 +0800
Subject: [PATCH] [lldb] Fix handling of unaligned results in DoFindInMemory
While encountering an unaligned result in DoFindInMemory, instead of
skipping already searched memory, the function incorrectly restart the
search from almost the beginning of the search range.
---
lldb/source/Target/Process.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 34d8b91a42833..da6d193f6364b 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -2008,7 +2008,7 @@ void Process::DoFindInMemory(lldb::addr_t start_addr, lldb::addr_t end_addr,
if (found_addr % alignment) {
// We need to check the alignment because the FindInMemory uses a special
// algorithm to efficiently search mememory but doesn't support alignment.
- start = llvm::alignTo(start + 1, alignment);
+ start = llvm::alignTo(found_addr + 1, alignment);
continue;
}
More information about the lldb-commits
mailing list