public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Luis Machado <luis.machado@arm.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] [Arm] Remove dead FPA code
Date: Mon, 3 Oct 2022 20:16:19 +0100	[thread overview]
Message-ID: <a8fb11bd-6019-0be1-ae3f-7a0a908aecca@palves.net> (raw)
In-Reply-To: <20220920123012.189293-1-luis.machado@arm.com>

On 2022-09-20 1:30 p.m., Luis Machado via Gdb-patches wrote:

> diff --git a/gdb/arch/arm.h b/gdb/arch/arm.h
> index 36757493406..74a6ba93bc7 100644
> --- a/gdb/arch/arm.h
> +++ b/gdb/arch/arm.h
> @@ -44,11 +44,6 @@ enum gdb_regnum {
>    ARM_SP_REGNUM = 13,		/* Contains address of top of stack */
>    ARM_LR_REGNUM = 14,		/* address to return to from a function call */
>    ARM_PC_REGNUM = 15,		/* Contains program counter */
> -  /* F0..F7 are the fp registers for the (obsolete) FPA architecture.  */

Shouldn't we leave behind a comment explaining why there's a hole between 15 and 25?

IIRC the numbers can't be changed since we need to handle the case when the target
doesn't send an xml tdesc, so it'd be good to help future readers understand why
there's a hole.


> -  ARM_F0_REGNUM = 16,		/* first floating point register */
> -  ARM_F3_REGNUM = 19,		/* last floating point argument register */
> -  ARM_F7_REGNUM = 23, 		/* last floating point register */
> -  ARM_FPS_REGNUM = 24,		/* floating point status register */
>    ARM_PS_REGNUM = 25,		/* Contains processor status */
>    ARM_WR0_REGNUM,		/* WMMX data registers.  */
>    ARM_WR15_REGNUM = ARM_WR0_REGNUM + 15,
> @@ -67,7 +62,6 @@ enum gdb_regnum {
>    ARM_FP_REGNUM = 11,		/* Frame register in ARM code, if used.  */
>    THUMB_FP_REGNUM = 7,		/* Frame register in Thumb code, if used.  */
>    ARM_LAST_ARG_REGNUM = ARM_A4_REGNUM,
> -  ARM_LAST_FP_ARG_REGNUM = ARM_F3_REGNUM
>  };
>  


> diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
> index ead9bbf46c5..b33a53612a6 100644
> --- a/gdb/arm-tdep.c
> +++ b/gdb/arm-tdep.c
> @@ -134,8 +134,6 @@ static struct cmd_list_element *showarmcmdlist = NULL;
>  static const char *const fp_model_strings[] =
>  {
>    "auto",
> -  "softfpa",
> -  "fpa",
>    "softvfp",
>    "vfp",
>    NULL
> @@ -226,9 +224,7 @@ static const char *const arm_register_names[] =
>   "r4",  "r5",  "r6",  "r7",	/*  4  5  6  7 */
>   "r8",  "r9",  "r10", "r11",	/*  8  9 10 11 */
>   "r12", "sp",  "lr",  "pc",	/* 12 13 14 15 */
> - "f0",  "f1",  "f2",  "f3",	/* 16 17 18 19 */
> - "f4",  "f5",  "f6",  "f7",	/* 20 21 22 23 */
> - "fps", "cpsr" };		/* 24 25       */
> + "cpsr" };			/* 25 */
>  

Don't the array indexes here need to match the register numbers?  The "cpsr" string
above is no longer at index 25 after this change.


> -/* For backward-compatibility we allow two 'g' packet lengths with
> -   the remote protocol depending on whether FPA registers are
> -   supplied.  M-profile targets do not have FPA registers, but some
> -   stubs already exist in the wild which use a 'g' packet which
> -   supplies them albeit with dummy values.  

So this patch is also removing support for these M-profile targets covered by
that last sentence.  Are we OK with that?


> -   The packet format which
> -   includes FPA registers should be considered deprecated for
> -   M-profile targets.  */
> -
> -static void
> -arm_register_g_packet_guesses (struct gdbarch *gdbarch)
> -{
> -  arm_gdbarch_tdep *tdep = gdbarch_tdep<arm_gdbarch_tdep> (gdbarch);
> -
> -  if (tdep->is_m)
> -    {
> -      const target_desc *tdesc;
> -
> -      /* If we know from the executable this is an M-profile target,
> -	 cater for remote targets whose register set layout is the
> -	 same as the FPA layout.  */
> -      tdesc = arm_read_mprofile_description (ARM_M_TYPE_WITH_FPA);
> -      register_remote_g_packet_guess (gdbarch,
> -				      ARM_CORE_REGS_SIZE + ARM_FP_REGS_SIZE,
> -				      tdesc);
> -
> -      /* The regular M-profile layout.  */
> -      tdesc = arm_read_mprofile_description (ARM_M_TYPE_M_PROFILE);
> -      register_remote_g_packet_guess (gdbarch, ARM_CORE_REGS_SIZE,
> -				      tdesc);
> -
> -      /* M-profile plus M4F VFP.  */
> -      tdesc = arm_read_mprofile_description (ARM_M_TYPE_VFP_D16);
> -      register_remote_g_packet_guess (gdbarch,
> -				      ARM_CORE_REGS_SIZE + ARM_VFP2_REGS_SIZE,
> -				      tdesc);
> -      /* M-profile plus MVE.  */
> -      tdesc = arm_read_mprofile_description (ARM_M_TYPE_MVE);
> -      register_remote_g_packet_guess (gdbarch, ARM_CORE_REGS_SIZE
> -				      + ARM_VFP2_REGS_SIZE
> -				      + ARM_INT_REGISTER_SIZE, tdesc);
> -
> -      /* M-profile system (stack pointers).  */
> -      tdesc = arm_read_mprofile_description (ARM_M_TYPE_SYSTEM);
> -      register_remote_g_packet_guess (gdbarch, 2 * ARM_INT_REGISTER_SIZE, tdesc);

And what about all these other non-FPA guesses?  Do you really mean to drop them?

> -    }
> -
> -  /* Otherwise we don't have a useful guess.  */
> -}
> -
>  /* Implement the code_of_frame_writable gdbarch method.  */
>  
>  static int


  parent reply	other threads:[~2022-10-03 19:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-20 12:30 Luis Machado
2022-09-20 12:47 ` Eli Zaretskii
2022-10-02 13:39 ` Enze Li
2022-10-03  8:27   ` Luis Machado
2022-10-03 17:33 ` John Baldwin
2022-10-03 19:16 ` Pedro Alves [this message]
2022-10-04  8:43   ` Luis Machado
2022-10-04 17:08     ` John Baldwin
2022-10-04 17:43       ` Luis Machado
2022-10-04 21:36         ` John Baldwin
2022-10-05  8:26           ` Luis Machado
2022-10-05  8:36             ` David Spickett
2022-10-05  8:36               ` David Spickett
2022-10-05 16:48             ` John Baldwin
2022-10-05 16:57               ` Richard Earnshaw
2022-10-06 13:02                 ` Luis Machado
2022-10-10 14:58             ` Pedro Alves
2022-10-13  7:23               ` Luis Machado
2022-10-13  8:29                 ` Pedro Alves
2022-10-13  9:40                   ` Luis Machado
2022-10-25 13:54                     ` Luis Machado
2022-11-14 14:30                     ` Simon Marchi
2022-10-10 14:56     ` Pedro Alves
2022-10-13  7:18       ` Luis Machado
2022-10-13  8:44         ` Pedro Alves
2022-10-13  9:15           ` Luis Machado

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=a8fb11bd-6019-0be1-ae3f-7a0a908aecca@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado@arm.com \
    /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).