[Lldb-commits] [lldb] [lldb] Add 'FindInMemory()' overload for PostMortemProcess. (PR #102536)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 12 09:18:51 PDT 2024


labath wrote:

> So the main idea is: if either ObjectFile or PostMortemProcess can return a reference to the data in the Peek calls, then should as long as they have this data mapped into the LLDB address space and can hand out a pointer to the data. If they can't, we should fall back to something that can copy the data into a buffer as mentioned with `CopyData` or `ReadMemory`. Core files or object files might compress up their data, in which case we wouldn't be able to hande out a buffer from calls to Peek, but we would need to unzip the buffer into the buffer supplied by CopyData and ReadMemory on the fly.

BTW, we have another bug where the person wants to use lldb to open `/proc/kcore` (which is a special file, which pretends to be a (ELF) core file, but actually points to the live memory of the system). This core file cannot be mmapped, because a) the kernel won't let us, b) it's as big as the virtual address space (128TB for me) of the kernel. It works fine with gdb, but lldb chokes when it tries to mmap it.

Anyway, I'm not going to work on this any time soon, just thought you might want to hear about another use case where its not possible to return a reference to existing data.

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


More information about the lldb-commits mailing list