[all-commits] [llvm/llvm-project] cc5c52: [lldb] Fix and speedup the `memory find` command (...
Pavel Labath via All-commits
all-commits at lists.llvm.org
Wed Sep 4 02:31:20 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: cc5c526c80a4cacf7ed5b7fbe50072594ec1aeaf
https://github.com/llvm/llvm-project/commit/cc5c526c80a4cacf7ed5b7fbe50072594ec1aeaf
Author: Pavel Labath <pavel at labath.sk>
Date: 2024-09-04 (Wed, 04 Sep 2024)
Changed paths:
M lldb/source/Target/Process.cpp
M lldb/test/API/functionalities/memory/holes/TestMemoryHoles.py
Log Message:
-----------
[lldb] Fix and speedup the `memory find` command (#104193)
This patch fixes an issue where the `memory find` command would
effectively stop searching after encountering a memory read error (which
could happen due to unreadable memory), without giving any indication
that it has done so (it would just print it could not find the pattern).
To make matters worse, it would not terminate after encountering this
error, but rather proceed to slowly increment the address pointer, which
meant that searching a large region could take a very long time (and
give the appearance that lldb is actually searching for the thing).
The patch fixes this first problem by detecting read errors and
skipping over (using GetMemoryRegionInfo) the unreadable parts of memory
and resuming the search after them. It also reads the memory in bulk
(`max(sizeof(pattern))`), which speeds up the search significantly (up
to 6x for live processes, 18x for core files).
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list