These exposed part could be consumed by libkvm easily to look for
symbols in a vmcore.
Sponsored by: Juniper Networks, Inc.
Differential D46537
linker: expose symbol and string table sections of elf_file khng on Sep 4 2024, 11:36 PM. Authored by Tags None Referenced Files
Details
Diff Detail
Event TimelineComment Actions
Could you please explain further? libkvm should have access to the kernel and KLD binaries, why does it need to inspect symbol tables in a vmcore?
Comment Actions Which in case of non-live kvm_open() libkvm does not call into kldsym(2). Currently we do not populate the linker_files list in the vmcore. In this scenario usually callers call the kvm_open function with a vmcore and a kernel ELF binary path, so libkvm will never have knowledge of the loaded modules. Comment Actions I do not follow the bit about "populating the linker_files list". The list should certainly be in the vmcore, that's how kgdb is able to figure out which KLDs were loaded. Comment Actions It does, but libkvm never walks through the list in the first place when kvm_open()-ing against minidump targets, unlike kgdb.
Comment Actions Or, I might just do it the way like how other debugger does - not using elf_file but doing adjustments with only ELF parsing libraries rather. Comment Actions As discussed elsewhere, I'd prefer to have libkvm walk the linker_files list and locate the corresponding binaries, like kgdb does. This way we avoid growing the kernel ABI. Comment Actions I'm also not sure what the end goal is here? Is it to have libkvm resolve symbols in loaded modules by name via kvm_nlist*() when looking at a crash dump? |