]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
FreeBSD x86 nat: Use register maps for GP register sets.
authorJohn Baldwin <jhb@FreeBSD.org>
Fri, 28 Jan 2022 19:14:37 +0000 (11:14 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Fri, 28 Jan 2022 19:14:37 +0000 (11:14 -0800)
commit00d7af046f12f18759b5b2c909d0b4527ac1857e
treed33e822e40937118700c31faf3a40c527664c7e0
parentb95a31ed5d2b34f1a4072d701f5cd51075e61c01
FreeBSD x86 nat: Use register maps for GP register sets.

Rather than using the x86-specific register offset tables, use
register maps to describe the layout of the general purpose registers
fetched via PT_GETREGS.  The sole user-visible difference is that
FreeBSD/amd64 will now report additional segment registers ($ds, $es,
$fs, and $gs) for both 32-bit and 64-bit processes.

As part of these changes, the FreeBSD x86 native targets no longer use
amd64-bsd-nat.c or i386-bsd-nat.c.  Remove FreeBSD-specific register
handling (for $fs_base, $gs_base, and XSAVE state) from these files.
Similarly, remove the global x86bsd_xsave_len from x86-bsd-nat.c.  The
FreeBSD x86 native targets use a static xsave_len instead.

While here, rework the probing of PT_GETXMMREGS on FreeBSD/i386.
Probe the ptrace op once in the target read_description method and
cache the result for the future similar to the way the status of XSAVE
support is probed in the read_description method.  In addition, return
the proper xcr0 mask (X87-only) for old kernels or systems without
either XSAVE or XMM support.
gdb/amd64-bsd-nat.c
gdb/amd64-fbsd-nat.c
gdb/amd64-fbsd-tdep.c
gdb/amd64-fbsd-tdep.h [new file with mode: 0644]
gdb/configure.nat
gdb/i386-bsd-nat.c
gdb/i386-fbsd-nat.c
gdb/i386-fbsd-tdep.h
gdb/x86-bsd-nat.c
gdb/x86-bsd-nat.h