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
F171116076: D34446.diff
Tue, Sep 8, 7:27 PM
F171098961: D34446.id103507.diff
Tue, Sep 8, 4:56 PM
Unknown Object (File)
Sun, Sep 6, 8:31 PM
Unknown Object (File)
Sat, Sep 5, 8:51 PM
Unknown Object (File)
Fri, Sep 4, 1:02 AM
Unknown Object (File)
Thu, Sep 3, 4:58 PM
Unknown Object (File)
Thu, Sep 3, 9:13 AM
Unknown Object (File)
Thu, Sep 3, 5:02 AM
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).