[Lldb-commits] [PATCH] D114675: [lldb] [Target] Support fallback to file address in ReadMemory()

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 30 02:17:18 PST 2021


labath added a comment.

In D114675#3160513 <https://reviews.llvm.org/D114675#3160513>, @mgorny wrote:

> Well, that's what happens with the core file I have and what you're asking for is really above my paygrade.

Maybe you should ask for a raise then. :P

> That said, this is kernel core dump, so load addresses should probably be the same as vm-addresses in the file.

Yes, and the real question why doesn't lldb know that. The point of the load addresses is to tell lldb where a particular section is loaded, so the problem/bug is that that is not happening. Normally this is the job of the dynamic loader plugin. ProcessElfCore is using `DynamicLoaderPOSIXDYLD`, but that is probably not correct for the kernel cores. If the file addresses in the kernel image are always correct, then it may be sufficient to just make it use `DynamicLoaderStatic` for these kinds of cores. If not, you may want to try implementing something like the existing minidump plugin, which directly sets load addresses based on the information in the minidump file (bypassing the dynamic loader plugin, which wouldn't really work anyway, as the relevant information would not be captured in the minidump).

Blindly falling back to file addresses is not a solution, because it will be wrong for the cases where the file and load addresses do not match (e.g. an elf pie binary will have a file address of zero, but that's definitely not where it will be loaded).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114675/new/

https://reviews.llvm.org/D114675



More information about the lldb-commits mailing list