Include process IDs in core dumps.
authorjhb <jhb@FreeBSD.org>
Mon, 18 Jul 2016 15:14:23 +0000 (15:14 +0000)
committerjhb <jhb@FreeBSD.org>
Mon, 18 Jul 2016 15:14:23 +0000 (15:14 +0000)
commit5535084c1ade872c35bbed3fa810c88a8332301a
tree6028700d122bfd12d481de8ead8137e745a83231
parentf39e6951abf6e4144528dc30472bc7fc82b3441a
Include process IDs in core dumps.

When threads were added to the kernel, the pr_pid member of the
NT_PRSTATUS note was repurposed to store LWP IDs instead of process
IDs.  However, the process ID was no longer recorded in core dumps.
This change adds a pr_pid field to prpsinfo (NT_PRSINFO).  Rather than
bumping the prpsinfo version number, note parsers can use the note's
payload size to determine if pr_pid is present.

Reviewed by: kib, emaste (older version)
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D7117
sys/kern/imgact_elf.c
sys/sys/procfs.h
usr.bin/gcore/elfcore.c