This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 6/11] Add ALPHA_MAX_REGISTER_SIZE
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Alan Hayward <Alan dot Hayward at arm dot com>
- Cc: "gdb-patches\@sourceware.org" <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Tue, 11 Apr 2017 10:16:22 +0100
- Subject: Re: [PATCH 6/11] Add ALPHA_MAX_REGISTER_SIZE
- Authentication-results: sourceware.org; auth=none
- References: <772F5764-0F2A-4F53-BC41-C36AF15BED21@arm.com>
Alan Hayward <Alan.Hayward@arm.com> writes:
> diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h
> index ab46ba56bef1ffb1cea541c506ffed6a5ae9b556..316d94d0bb53e9bc7943d406bf81f7d597437ff3 100644
> --- a/gdb/alpha-tdep.h
> +++ b/gdb/alpha-tdep.h
> @@ -26,6 +26,9 @@ struct regcache;
> real way to know how big a register is. */
> #define ALPHA_REGISTER_SIZE 8
>
> +/* Big enough to hold the size of the largest register in bytes. */
> +#define ALPHA_MAX_REGISTER_SIZE 8
> +
> --- a/gdb/alpha-tdep.c
> +++ b/gdb/alpha-tdep.c
> @@ -244,7 +244,7 @@ alpha_register_to_value (struct frame_info *frame, int regnum,
> int *optimizedp, int *unavailablep)
> {
> struct gdbarch *gdbarch = get_frame_arch (frame);
> - gdb_byte in[MAX_REGISTER_SIZE];
> + gdb_byte in[ALPHA_MAX_REGISTER_SIZE];
>
> /* Convert to TYPE. */
> if (!get_frame_register_bytes (frame, regnum, 0,
We can use get_frame_register_value, so "in" can be removed.
> @@ -266,7 +266,7 @@ static void
> alpha_value_to_register (struct frame_info *frame, int regnum,
> struct type *valtype, const gdb_byte *in)
> {
> - gdb_byte out[MAX_REGISTER_SIZE];
> + gdb_byte out[ALPHA_MAX_REGISTER_SIZE];
Why don't you use ALPHA_REGISTER_SIZE?
--
Yao (齐尧)