From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org
Subject: Re: [PING] [PATCH 0/8] Switch FreeBSD x86 to using register maps for GP registers
Date: Mon, 18 Oct 2021 13:46:21 -0700 [thread overview]
Message-ID: <40ec1ffc-a511-a3e6-0115-9aa346c745d7@FreeBSD.org> (raw)
In-Reply-To: <116879ac-5d1f-8c61-1cdf-d52052c9b502@FreeBSD.org>
On 9/14/21 8:43 AM, John Baldwin wrote:
> On 8/10/21 8:56 AM, John Baldwin wrote:
>> On 7/14/21 7:07 AM, John Baldwin wrote:
>>> 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.
>>
>> Ping. Patch 4 is the only one that isn't FreeBSD-specific.
>
> Pinging again. I could perhaps push the first 3 patches as they are
> FreeBSD specific. Patch 4 is a prereq for the following patches however.
Pinging again.
>>> 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
>>>
>>
>>
>
>
--
John Baldwin
next prev parent reply other threads:[~2021-10-18 20:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-14 14:07 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 [this message]
2022-01-28 15:44 ` Andrew Burgess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40ec1ffc-a511-a3e6-0115-9aa346c745d7@FreeBSD.org \
--to=jhb@freebsd.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).