This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 1/4] Add helper functions to trad_frame to support register cache maps.
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: John Baldwin <jhb at FreeBSD dot org>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Cc: "andrew dot burgess at embecosm dot com" <andrew dot burgess at embecosm dot com>, "jimw at sifive dot com" <jimw at sifive dot com>
- Date: Thu, 27 Sep 2018 19:31:41 +0000
- Subject: Re: [PATCH v2 1/4] Add helper functions to trad_frame to support register cache maps.
- References: <20180924205151.22217-1-jhb@FreeBSD.org> <20180924205151.22217-2-jhb@FreeBSD.org>
On 2018-09-24 04:51 PM, John Baldwin wrote:
> Currently, signal frame handlers require explicitly coded calls to
> trad_frame_set_reg_addr() to describe the location of saved registers
> within a signal frame. This change permits the regcache_map_entry
> arrays used with regcache::supply_regset and regcache::collect_regset
> to be used to describe a block of saved registers given an initial
> address for the register block.
>
> Some systems use the same layout for registers in core dump notes,
> native register sets with ptrace(), and the register contexts saved in
> signal frames. On these systems, a single register map can now be
> used to describe the layout of registers in all three places.
>
> If a register map entry's size does not match the native size of a
> register, try to match the semantics used by
> regcache::transfer_regset. If a register slot is too large, assume
> that the register's value is stored in the first N bytes and ignore
> the remaning bytes. If the register slot is smaller than the
> register, assume the slot holds the low N bytes of the register's
> value. Read these low N bytes from the target and zero-extend them to
> generate a register value.
LGTM. It sounds very good to de-duplicate the knowledge of the register
layout in those structures.
Simon