From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org
Subject: Re: [PING 4] [PATCH 0/5] Improve support for regcache_map_entry with variable register base
Date: Thu, 20 Oct 2022 13:26:36 -0700 [thread overview]
Message-ID: <13906179-7682-8d0e-06fa-e50084029a17@FreeBSD.org> (raw)
In-Reply-To: <5dabc301-e7af-1e8c-a70d-555ce22c8064@FreeBSD.org>
On 9/20/22 10:50 AM, John Baldwin wrote:
> On 8/22/22 7:11 PM, John Baldwin wrote:
>> On 7/21/22 7:53 AM, John Baldwin wrote:
>>> On 7/7/22 5:58 PM, John Baldwin wrote:
>>>> When I added support for TLS to the ARM and AArch64 architectures on
>>>> FreeBSD, I had to construct register maps and associated register sets
>>>> on the fly in both the callback for processing register core dump
>>>> notes and in the native target routines to fetch and store registers.
>>>>
>>>> The reason I had to create these on the fly is that the register
>>>> number was not known at compile time, so the register map and register
>>>> set could not be constant structures shared among the -tdep and -nat
>>>> code the way other register sets were.
>>>>
>>>> This series aims to rectify that. The first patch adds new variants
>>>> of regcache::collect_regset and regcache::supply_regset that accept an
>>>> additional 'regbase' argument. When these functions iterate over
>>>> regcache map entries, the effective register number for the entry is
>>>> computed by adding the value in the entry to 'regbase' permittting the
>>>> regcache map entries to hold relative register numbers for a block of
>>>> registers.
>>>>
>>>> The rest of the series then makes use of this to use a single, shared
>>>> register map and register set for TLS on FreeBSD/ARM and
>>>> FreeBSD/AArch64. Using this requires custom supply and collect regset
>>>> routines for the TLS regsets that extract the base register number
>>>> from the gdbarch's tdep and invoke the new regcache class methods, so
>>>> patch 2 updates the wrappers for dealing with regsets in fbsd-nat to
>>>> always invoke the regset routines from the regset instead of directly
>>>> calling the default functions. Patch 3 is another change to fbsd-nat
>>>> to cope with the fact that regcache_map_supplies() needs to pass in
>>>> the relative register number in the wrapper routines rather than the
>>>> absolute register number.
>>>>
>>>> Patches 4 and 5 are the updates to the ARM and AArch64 FreeBSD
>>>> architectures and targets.
>>>>
>>>> I have not done the work to make use of this in the Linux AArch64
>>>> architecture, though I think it would apply to at least the TLS and
>>>> MTE register sets there in a similar fashion. SVE is harder because
>>>> the register sizes change (though SVE might be able to make use of
>>>> this if register_size() returns the right value by using a register
>>>> size of 0 in the relevant register cache map entries).
>>>>
>>>> John Baldwin (5):
>>>> regcache: Add collect/supply_regset variants that accept a register
>>>> base.
>>>> fbsd-nat: Use regset supply/collect methods.
>>>> fbsd-nat: Pass an optional register base to the register set helpers.
>>>> arm-fbsd: Use a static regset for the TLS register set.
>>>> aarch64-fbsd: Use a static regset for the TLS register set.
>>>>
>>>> gdb/aarch64-fbsd-nat.c | 36 +++------------------------
>>>> gdb/aarch64-fbsd-tdep.c | 54 ++++++++++++++++++++++++++++-------------
>>>> gdb/aarch64-fbsd-tdep.h | 1 +
>>>> gdb/arm-fbsd-nat.c | 34 +++-----------------------
>>>> gdb/arm-fbsd-tdep.c | 52 +++++++++++++++++++++++++++------------
>>>> gdb/arm-fbsd-tdep.h | 1 +
>>>> gdb/fbsd-nat.c | 42 +++++++++++++++++---------------
>>>> gdb/fbsd-nat.h | 49 +++++++++++++++++++++----------------
>>>> gdb/regcache.c | 28 ++++++++++++++++++---
>>>> gdb/regcache.h | 24 ++++++++++++++++--
>>>> 10 files changed, 181 insertions(+), 140 deletions(-)
>>>
>>> Ping.
>>>
>>
>>
>
> Pinging again. Only patch 1 needs approval by another maintainer, the rest
> are FreeBSD specific.
>
--
John Baldwin
next prev parent reply other threads:[~2022-10-20 20:26 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-08 0:58 John Baldwin
2022-07-08 0:58 ` [PATCH 1/5] regcache: Add collect/supply_regset variants that accept a " John Baldwin
2022-11-22 19:56 ` Simon Marchi
2022-11-22 20:18 ` Simon Marchi
2022-11-22 22:32 ` John Baldwin
2022-07-08 0:58 ` [PATCH 2/5] fbsd-nat: Use regset supply/collect methods John Baldwin
2022-11-22 20:20 ` Simon Marchi
2022-07-08 0:58 ` [PATCH 3/5] fbsd-nat: Pass an optional register base to the register set helpers John Baldwin
2022-11-22 20:38 ` Simon Marchi
2022-11-22 22:16 ` John Baldwin
2022-11-22 22:25 ` John Baldwin
2022-07-08 0:58 ` [PATCH 4/5] arm-fbsd: Use a static regset for the TLS register set John Baldwin
2022-11-22 20:39 ` Simon Marchi
2022-07-08 0:58 ` [PATCH 5/5] aarch64-fbsd: " John Baldwin
2022-11-22 20:40 ` Simon Marchi
2022-07-21 14:53 ` [PATCH 0/5] Improve support for regcache_map_entry with variable register base John Baldwin
2022-08-22 18:11 ` [PING] " John Baldwin
2022-09-20 17:50 ` John Baldwin
2022-10-20 20:26 ` John Baldwin [this message]
2022-11-21 18:21 ` [PING 5] " John Baldwin
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=13906179-7682-8d0e-06fa-e50084029a17@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).