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)
Mar 22 2024, 7:53 PM
Unknown Object (File)
Feb 9 2024, 5:21 PM
Unknown Object (File)
Jan 3 2024, 1:40 PM
Unknown Object (File)
Jan 3 2024, 1:40 PM
Unknown Object (File)
Jan 3 2024, 1:40 PM
Unknown Object (File)
Jan 3 2024, 1:05 PM
Unknown Object (File)
Dec 20 2023, 6:13 AM
Unknown Object (File)
Dec 2 2023, 7:00 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).