Page MenuHomeFreeBSD

Store core dump notes for all valid register sets for FreeBSD processes.
ClosedPublic

Authored by jhb on Mar 4 2022, 10:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Sep 24, 11:35 PM
Unknown Object (File)
Tue, Sep 24, 8:21 PM
Unknown Object (File)
Tue, Sep 24, 2:29 AM
Unknown Object (File)
Thu, Sep 19, 1:59 AM
Unknown Object (File)
Mon, Sep 16, 11:16 AM
Unknown Object (File)
Fri, Sep 13, 11:13 PM
Unknown Object (File)
Thu, Sep 12, 3:00 PM
Unknown Object (File)
Tue, Sep 10, 10:10 PM
Subscribers

Details

Summary

In particular, use a generic wrapper around struct regset rather than
requiring per-regset helpers. This helper replaces the MI
elfN(note_prstatus) and elfN(note_fpregset) helpers. It also
removes the need to explicitly dump NT_ARM_ADDR_MASK in the arm64
__elfN(dump_thread).

Sponsored by: University of Cambridge, Google, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Mar 4 2022, 10:58 PM

I've tested this on both 32-bit arm and aarch64. I'm also working on testing this on amd64. For !aarch64 it effects NT_PRSTATUS and NT_FPREGSET. The goal of this is that one can simple define a new regset with a get method and it will then be dumped for all threads in core dumps without needing code in elf_dump_thread().

markj added inline comments.
sys/kern/imgact_elf.c
2336

Assert SV_ABI_FREEBSD is clear in sv->sv_flags?

This revision is now accepted and ready to land.Mar 7 2022, 6:10 PM
sys/kern/imgact_elf.c
2336

I kind of suspect I could even assert that regsetp isn't NULL here entirely (or not bother asserting and just let it fault). Non-FreeBSD ABIs don't use this function (the caller writes out FreeBSD-specific NT_THRMISC, etc.).

Tested on amd64 (both 32-bit and 64-bit processes).