From: Andrew Cagney <ac131313@redhat.com>
To: Richard Henderson <rth@twiddle.net>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] kill deprecated register-related hooks on alpha
Date: Sun, 01 Jun 2003 18:31:00 -0000 [thread overview]
Message-ID: <3EDA4693.6090401@redhat.com> (raw)
In-Reply-To: <20030601182123.GA4380@twiddle.net>
> As far as I can tell, these don't even have to be replaced by
> anything?
That's correct. GDB computes equivalent values at run time. Thanks for
zapping these.
> Certainly things seem to work with this installed;
> it even results in a few less testsuite failures if you can
> imagine that.
Which? Something to do with frames?
(yes definitly fine to commit)
Andrew
> * alpha-nat.c (fetch_osf_core_registers): Use ALPHA_REGISTER_SIZE
> instead of ALPHA_MAX_REGISTER_RAW_SIZE.
> (supply_gregset): Likewise.
> * alpha-tdep.c (alpha_store_return_value): Likewise.
> (alpha_get_longjmp_target): Likewise.
> (alpha_register_name): Constify array.
> (alpha_gdbarch_init): Remove deprecated_fp_regnum,
> deprecated_register_size, deprecated_register_bytes,
> deprecated_max_register_raw_size, deprecated_max_register_virtual_size.
> * alpha-tdep.h (ALPHA_MAX_REGISTER_RAW_SIZE): Remove.
> (ALPHA_MAX_REGISTER_VIRTUAL_SIZE): Remove.
>
> Index: alpha-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/alpha-nat.c,v
> retrieving revision 1.16
> diff -c -p -d -u -r1.16 alpha-nat.c
> --- alpha-nat.c 29 Apr 2003 01:49:45 -0000 1.16
> +++ alpha-nat.c 1 Jun 2003 17:59:58 -0000
> @@ -94,8 +94,7 @@ fetch_osf_core_registers (char *core_reg
> EF_PC, -1
> #endif
> };
> - static char zerobuf[ALPHA_MAX_REGISTER_RAW_SIZE] =
> - {0};
> + static char zerobuf[ALPHA_REGISTER_SIZE] = {0};
>
> for (regno = 0; regno < NUM_REGS; regno++)
> {
> @@ -202,8 +201,7 @@ supply_gregset (gdb_gregset_t *gregsetp)
> {
> register int regi;
> register long *regp = ALPHA_REGSET_BASE (gregsetp);
> - static char zerobuf[ALPHA_MAX_REGISTER_RAW_SIZE] =
> - {0};
> + static char zerobuf[ALPHA_REGISTER_SIZE] = {0};
>
> for (regi = 0; regi < 31; regi++)
> supply_register (regi, (char *) (regp + regi));
> Index: alpha-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/alpha-tdep.c,v
> retrieving revision 1.89
> diff -c -p -d -u -r1.89 alpha-tdep.c
> --- alpha-tdep.c 1 Jun 2003 16:02:50 -0000 1.89
> +++ alpha-tdep.c 1 Jun 2003 17:59:59 -0000
> @@ -47,7 +47,7 @@
> static const char *
> alpha_register_name (int regno)
> {
> - static char *register_names[] =
> + static const char * const register_names[] =
> {
> "v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6",
> "t7", "s0", "s1", "s2", "s3", "s4", "s5", "fp",
> @@ -61,10 +61,10 @@ alpha_register_name (int regno)
> };
>
> if (regno < 0)
> - return (NULL);
> + return NULL;
> if (regno >= (sizeof(register_names) / sizeof(*register_names)))
> - return (NULL);
> - return (register_names[regno]);
> + return NULL;
> + return register_names[regno];
> }
>
> static int
> @@ -347,14 +348,14 @@ alpha_extract_return_value (struct type
> static void
> alpha_store_return_value (struct type *valtype, char *valbuf)
> {
> - char raw_buffer[ALPHA_MAX_REGISTER_RAW_SIZE];
> + char raw_buffer[ALPHA_REGISTER_SIZE];
> int regnum = ALPHA_V0_REGNUM;
> int length = TYPE_LENGTH (valtype);
>
> if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
> {
> regnum = FP0_REGNUM;
> - length = REGISTER_RAW_SIZE (regnum);
> + length = ALPHA_REGISTER_SIZE;
> alpha_register_convert_to_raw (valtype, regnum, valbuf, raw_buffer);
> }
> else
> @@ -509,7 +510,7 @@ alpha_get_longjmp_target (CORE_ADDR *pc)
> {
> struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
> CORE_ADDR jb_addr;
> - char raw_buffer[ALPHA_MAX_REGISTER_RAW_SIZE];
> + char raw_buffer[ALPHA_REGISTER_SIZE];
>
> jb_addr = read_register (ALPHA_A0_REGNUM);
>
> @@ -1242,19 +1243,13 @@ alpha_gdbarch_init (struct gdbarch_info
> /* Register info */
> set_gdbarch_num_regs (gdbarch, ALPHA_NUM_REGS);
> set_gdbarch_sp_regnum (gdbarch, ALPHA_SP_REGNUM);
> - set_gdbarch_deprecated_fp_regnum (gdbarch, ALPHA_FP_REGNUM);
> set_gdbarch_pc_regnum (gdbarch, ALPHA_PC_REGNUM);
> set_gdbarch_fp0_regnum (gdbarch, ALPHA_FP0_REGNUM);
>
> set_gdbarch_register_name (gdbarch, alpha_register_name);
> - set_gdbarch_deprecated_register_size (gdbarch, ALPHA_REGISTER_SIZE);
> - set_gdbarch_deprecated_register_bytes (gdbarch, ALPHA_REGISTER_BYTES);
> set_gdbarch_register_byte (gdbarch, alpha_register_byte);
> set_gdbarch_register_raw_size (gdbarch, alpha_register_raw_size);
> - set_gdbarch_deprecated_max_register_raw_size (gdbarch, ALPHA_MAX_REGISTER_RAW_SIZE);
> set_gdbarch_register_virtual_size (gdbarch, alpha_register_virtual_size);
> - set_gdbarch_deprecated_max_register_virtual_size (gdbarch,
> - ALPHA_MAX_REGISTER_VIRTUAL_SIZE);
> set_gdbarch_register_virtual_type (gdbarch, alpha_register_virtual_type);
>
> set_gdbarch_cannot_fetch_register (gdbarch, alpha_cannot_fetch_register);
> Index: alpha-tdep.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/alpha-tdep.h,v
> retrieving revision 1.13
> diff -c -p -d -u -r1.13 alpha-tdep.h
> --- alpha-tdep.h 31 May 2003 00:27:46 -0000 1.13
> +++ alpha-tdep.h 1 Jun 2003 17:59:59 -0000
> @@ -34,12 +34,6 @@
> register state. */
> #define ALPHA_REGISTER_BYTES (ALPHA_NUM_REGS * 8)
>
> -/* Largest value REGISTER_RAW_SIZE can have. */
> -#define ALPHA_MAX_REGISTER_RAW_SIZE 8
> -
> -/* Largest value REGISTER_VIRTUAL_SIZE can have. */
> -#define ALPHA_MAX_REGISTER_VIRTUAL_SIZE 8
> -
> /* Register numbers of various important registers. Note that most of
> these values are "real" register numbers, and correspond to the
> general registers of the machine, and DEPRECATED_FP_REGNUM is a
>
next prev parent reply other threads:[~2003-06-01 18:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-01 18:21 Richard Henderson
2003-06-01 18:31 ` Andrew Cagney [this message]
2003-06-01 18:39 ` Richard Henderson
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=3EDA4693.6090401@redhat.com \
--to=ac131313@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=rth@twiddle.net \
/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