diff options
author | jhb <jhb@FreeBSD.org> | 2016-10-28 03:54:19 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2016-10-28 03:54:19 +0000 |
commit | 4c1afdb90f1d81b4565cdaf52a555ad8c7f3faea (patch) | |
tree | 751399751a7dd81fd5b871b7460f4c155f740995 /usr.bin | |
parent | 7dcc3aa4da1bb5157bfc16f2bbaa3540d8df47e8 (diff) | |
download | FreeBSD-src-4c1afdb90f1d81b4565cdaf52a555ad8c7f3faea.zip FreeBSD-src-4c1afdb90f1d81b4565cdaf52a555ad8c7f3faea.tar.gz |
MFC 303002: 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.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/gcore/elfcore.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.bin/gcore/elfcore.c b/usr.bin/gcore/elfcore.c index 6493688..6f617ee 100644 --- a/usr.bin/gcore/elfcore.c +++ b/usr.bin/gcore/elfcore.c @@ -586,6 +586,7 @@ elf_note_prpsinfo(void *arg, size_t *sizep) } else strlcpy(psinfo->pr_psargs, kip.ki_comm, sizeof(psinfo->pr_psargs)); + psinfo->pr_pid = pid; *sizep = sizeof(*psinfo); return (psinfo); |