]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
x86: Add a NT_X86_SEGBASES register set.
authorJohn Baldwin <jhb@FreeBSD.org>
Thu, 24 Mar 2022 18:36:19 +0000 (11:36 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 24 Mar 2022 18:36:19 +0000 (11:36 -0700)
commit931983ee0864079c5f1be0a6b3b9ef097d84ffba
tree2a3445586ca45c1853374d197e8fd672256bb296
parent196cfd0b2eb640a63d007a7e9c3a74e4256255f3
x86: Add a NT_X86_SEGBASES register set.

This register set contains the values of the fsbase and gsbase
registers.  Note that these registers can already be controlled
individually via ptrace(2) via MD operations, so the main reason for
adding this is to include these register values in core dumps.  In
particular, this will enable looking up the value of TLS variables
from core dumps in gdb.

The value of NT_X86_SEGBASES was chosen to match the value of
NT_386_TLS on Linux.  The notes serve similar purposes, but FreeBSD
will never dump a note equivalent to NT_386_TLS (which dumps a single
segment descriptor rather than a pair of addresses) and picking a
currently-unused value in the NT_X86_* range could result in a future
conflict.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D34650
contrib/elftoolchain/readelf/readelf.c
sys/amd64/amd64/ptrace_machdep.c
sys/amd64/ia32/ia32_reg.c
sys/i386/i386/ptrace_machdep.c
sys/sys/elf_common.h
sys/x86/include/reg.h
usr.bin/gcore/elfcore.c