Re: [PATCH 4/5] arm-fbsd: Use a static regset for the TLS register set.

Simon Marchi via Gdb-patches
2022-11-22T20:39:27Z

> diff --git a/gdb/arm-fbsd-tdep.c b/gdb/arm-fbsd-tdep.c
> index 483820c1092..2a73643b763 100644
> --- a/gdb/arm-fbsd-tdep.c
> +++ b/gdb/arm-fbsd-tdep.c
> @@ -52,6 +52,12 @@ static const struct regcache_map_entry arm_fbsd_vfpregmap[] =
> { 0 }
> };
>
> +static const struct regcache_map_entry arm_fbsd_tls_regmap[] =
> + {
> + { 1, 0, 4 },
> + { 0 }
> + };
I would suggest adding a comment to say that this regno is relative, and
relative to what.

> +
> /* In a signal frame, sp points to a 'struct sigframe' which is
> defined as:
>
> @@ -151,6 +157,34 @@ const struct regset arm_fbsd_vfpregset =
> regcache_supply_regset, regcache_collect_regset
> };
>
> +static void
> +arm_fbsd_supply_tls_regset (const struct regset *regset,
> + struct regcache *regcache,
> + int regnum, const void *buf, size_t size)
> +{
> + struct gdbarch *gdbarch = regcache->arch ();
> + arm_gdbarch_tdep *tdep = (arm_gdbarch_tdep *) gdbarch_tdep (gdbarch);

These can now be changed to:

arm_gdbarch_tdep *tdep = gdbarch_tdep<arm_gdbarch_tdep> (gdbarch);

With those fixed,

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon