public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/8] Switch FreeBSD x86 to using register maps for GP registers
@ 2021-07-14 14:07 John Baldwin
  2021-07-14 14:07 ` [PATCH 1/8] Remove vestigal FreeBSD/i386 3.x support John Baldwin
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: John Baldwin @ 2021-07-14 14:07 UTC (permalink / raw)
  To: gdb-patches

The x86 architectures in GDB provide existing helpers for parsing
general-purpose register sets.  However, these helpers have some
limitations, such as assuming that registers are always full size.  On
FreeBSD/amd64 in particular, segment registers are stored as 16-bit
quantities that in some cases are packed together.  GDB for historical
reasons treats these 16-bit registers as 32 bits in size.  Using the
more generic regcache_map_entry to describe the GP register sets
permits supporting these registers as 16-bit values.  In addition, the
FreeBSD x86 signal frames have included the base address of the FS and
GS segments (equivalent to the fs_base and gs_base registers), but the
existing signal context helpers were written before those registers
were added to GDB.

Longer term my goal is to use regcache_map_entry-based register sets
in FreeBSD gdbserver support to simplify the implementation.

Note that patch 4 fixes an issue in regcache_collect_regset where it
didn't quite do what I thought it did.  I believe the change is ok,
but it definitely warrants review.

I have tested this on both FreeBSD/amd64 (32-bit and 64-bit processes)
and FreeBSD/i386.

John Baldwin (8):
  Remove vestigal FreeBSD/i386 3.x support.
  Remove support for pre-5.0 FreeBSD/i386 signal trampolines.
  FreeBSD x86: Remove fallback for detecting signal trampolines by
    address.
  regcache: Zero-extend small registers described by a register map.
  Use register maps for gp regsets on FreeBSD/x86 core dumps.
  FreeBSD x86: Use tramp-frame for signal frames.
  fbsd-nat: Return a bool from fetch_register_set and
    store_register_set.
  FreeBSD x86 nat: Use register maps for GP register sets.

 gdb/amd64-bsd-nat.c   |  96 ---------
 gdb/amd64-fbsd-nat.c  | 346 ++++++++++++++++++-------------
 gdb/amd64-fbsd-tdep.c | 279 ++++++++++++++-----------
 gdb/amd64-fbsd-tdep.h |  27 +++
 gdb/amd64-tdep.h      |   5 -
 gdb/configure.nat     |   4 +-
 gdb/fbsd-nat.c        |   8 +-
 gdb/fbsd-nat.h        |  21 +-
 gdb/i386-bsd-nat.c    |  98 +--------
 gdb/i386-fbsd-nat.c   | 255 +++++++++++++++++++----
 gdb/i386-fbsd-tdep.c  | 461 ++++++++++++++++++------------------------
 gdb/i386-fbsd-tdep.h  |   4 +
 gdb/i386-tdep.h       |   4 -
 gdb/regcache.c        |   7 +-
 gdb/x86-bsd-nat.c     |   4 -
 gdb/x86-bsd-nat.h     |   3 -
 16 files changed, 844 insertions(+), 778 deletions(-)
 create mode 100644 gdb/amd64-fbsd-tdep.h

-- 
2.31.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-01-28 15:44 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-14 14:07 [PATCH 0/8] Switch FreeBSD x86 to using register maps for GP registers John Baldwin
2021-07-14 14:07 ` [PATCH 1/8] Remove vestigal FreeBSD/i386 3.x support John Baldwin
2021-07-14 14:07 ` [PATCH 2/8] Remove support for pre-5.0 FreeBSD/i386 signal trampolines John Baldwin
2021-07-14 14:07 ` [PATCH 3/8] FreeBSD x86: Remove fallback for detecting signal trampolines by address John Baldwin
2021-07-14 14:07 ` [PATCH 4/8] regcache: Zero-extend small registers described by a register map John Baldwin
2021-10-19  8:36   ` Andrew Burgess
2021-10-19 16:31     ` John Baldwin
2021-10-26 21:17       ` John Baldwin
2021-12-22 21:20         ` John Baldwin
2022-01-26 18:43           ` John Baldwin
2022-01-28 15:43         ` Andrew Burgess
2021-07-14 14:07 ` [PATCH 5/8] Use register maps for gp regsets on FreeBSD/x86 core dumps John Baldwin
2021-07-14 14:07 ` [PATCH 6/8] FreeBSD x86: Use tramp-frame for signal frames John Baldwin
2021-07-14 14:07 ` [PATCH 7/8] fbsd-nat: Return a bool from fetch_register_set and store_register_set John Baldwin
2021-07-14 14:07 ` [PATCH 8/8] FreeBSD x86 nat: Use register maps for GP register sets John Baldwin
2021-08-10 15:56 ` [PATCH 0/8] Switch FreeBSD x86 to using register maps for GP registers John Baldwin
2021-09-14 15:43   ` [PING] " John Baldwin
2021-10-18 20:46     ` John Baldwin
2022-01-28 15:44 ` Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).