Skip to content

Commit fdc1638

Browse files
committed
[lldb] [Process/elf-core] Disable for FreeBSD vmcores
Recognize FreeBSD vmcores (kernel core dumps) through OS ABI = 0xFF + ELF version = 0, and do not process them via the elf-core plugin. While these files use ELF as a container format, they contain raw memory dump rather than proper VM segments and therefore are not usable to the elf-core plugin. Differential Revision: https://reviews.llvm.org/D114967
1 parent 1a87a18 commit fdc1638

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ lldb::ProcessSP ProcessElfCore::CreateInstance(lldb::TargetSP target_sp,
6464
DataExtractor data(data_sp, lldb::eByteOrderLittle, 4);
6565
lldb::offset_t data_offset = 0;
6666
if (elf_header.Parse(data, &data_offset)) {
67+
// Check whether we're dealing with a raw FreeBSD "full memory dump"
68+
// ELF vmcore that needs to be handled via FreeBSDKernel plugin instead.
69+
if (elf_header.e_ident[7] == 0xFF && elf_header.e_version == 0)
70+
return process_sp;
6771
if (elf_header.e_type == llvm::ELF::ET_CORE)
6872
process_sp = std::make_shared<ProcessElfCore>(target_sp, listener_sp,
6973
*crash_file);

0 commit comments

Comments
 (0)