This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] Add support for machine-independent NetBSD ELF core notes.
ClosedPublic

Authored by fcambus on Nov 26 2021, 5:16 AM.

Details

Summary

Notes generated in NetBSD core files provide additional information about processes.

These notes are described in core.5, which can be viewed here: https://man.netbsd.org/core.5

Diff Detail

Event Timeline

fcambus created this revision.Nov 26 2021, 5:16 AM
fcambus requested review of this revision.Nov 26 2021, 5:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 26 2021, 5:16 AM
krytarowski accepted this revision.Nov 26 2021, 9:05 AM
This revision is now accepted and ready to land.Nov 26 2021, 9:05 AM
MaskRay added inline comments.Nov 26 2021, 10:26 AM
llvm/test/tools/llvm-readobj/ELF/note-netbsd-core.test
16

Delete trailing space

llvm/tools/llvm-readobj/ELFDumper.cpp
5463

Is it startswith? The test doesn't have a case for NetBSD-CORE with a suffix.

fcambus updated this revision to Diff 390169.Nov 27 2021, 10:31 AM
fcambus marked 2 inline comments as done.

Here is a new revision with the trailing spaces removed and linting
issue fixed, and updated tests.

llvm/tools/llvm-readobj/ELFDumper.cpp
5463

Yes, startswith is required as some notes have names of the form NetBSD-CORE@nn where nn is the LWP ID of the execution context.

But you are right, the test was wrong for NT_NETBSDCORE_LWPSTATUS notes, sorry about that.

MaskRay accepted this revision.Nov 27 2021, 11:59 AM
MaskRay added inline comments.
llvm/tools/llvm-readobj/ELFDumper.cpp
5463

Check ELFType == ELF::ET_CORE first to skip string comparison for the majority cases.

fcambus updated this revision to Diff 390264.Nov 29 2021, 12:24 AM
fcambus marked an inline comment as done.

Check ELFType == ELF::ET_CORE first in getNoteTypeName().

fcambus marked an inline comment as done.Nov 29 2021, 12:25 AM