[Lldb-commits] [lldb] Add AddressRange to SB API (PR #92014)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Tue May 14 10:41:54 PDT 2024


clayborg wrote:

> > I forgot to ask, what is the motivation behind this change? Is there something you can't do with the SBAPI right now or that is better expressed with SBAddressRange and SBAddressRangeList?
> 
> Yes, I want to add the following API:
> 
> lldb::SBError SBProcess::FindInMemory(const SBAddressRangeList &ranges, const void *buf, uint64_t size, SBAddressRangeList &matches, size_t alignment);

Yeah, we have no `SBProcess::FindMemory()` API, but we do have a "memory find" command. We want to expose simple memory finds, and complex ones like above:
```
addr_t SBProcess::FindInMemory(SBAddressRange &range, const void *buf, uint64_t size, size_t alignment);
SBError SBProcess::FindInMemory(const SBAddressRangeList &ranges, const void *buf, uint64_t size, SBAddressRangeList &matches, size_t alignment);
```
We then want to plumb this through to the lldb_private::Process plug-ins so we can allow plug-ins to do things more efficiently. Mostly for core files where we could parallelize the memory search. 



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


More information about the lldb-commits mailing list