This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [Process/elf-core] Disable for FreeBSD vmcores
ClosedPublic

Authored by mgorny on Dec 2 2021, 9:36 AM.

Details

Summary

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.

Diff Detail

Event Timeline

mgorny created this revision.Dec 2 2021, 9:36 AM
mgorny requested review of this revision.Dec 2 2021, 9:36 AM
emaste added inline comments.Dec 3 2021, 1:59 PM
lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
67

Maybe "FreeBSD full ELF vmcore" or such? We may have three different FreeBSD vmcore formats to deal with

  1. kernel-generated ELF dumps (sysctl debug.minidump=0)
  2. kernel-generated minidumps (sysctl debug.minidump=1)
  3. minidump post-processed by (a fixed version of) https://reviews.freebsd.org/D19253
mgorny updated this revision to Diff 391808.Dec 3 2021, 9:20 PM

Try making the comment more precise.

mgorny updated this revision to Diff 391809.Dec 3 2021, 9:21 PM
mgorny marked an inline comment as done.

Fix thinko.

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

Good idea. I've changed it to use "full memory dump" to follow the Handbook, and added "raw" to make it clearer we're not talking of the converted version.

mgorny updated this revision to Diff 391822.Dec 4 2021, 3:16 AM

Add arm64 support, simplify logic in ThreadFreeBSDKernel, handle unsupported architectures gracefully (instead of crashing).

mgorny updated this revision to Diff 391826.Dec 4 2021, 3:47 AM

Sorry, accidentally uploaded the patch to the wrong revision.

labath accepted this revision.Dec 6 2021, 5:30 AM
This revision is now accepted and ready to land.Dec 6 2021, 5:30 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptDec 6 2021, 5:55 AM