From: Luis Machado <luis.machado@arm.com>
To: Pedro Alves <pedro@palves.net>, gdb-patches@sourceware.org
Subject: Re: [PATCH] [Arm] Remove dead FPA code
Date: Thu, 13 Oct 2022 10:15:11 +0100 [thread overview]
Message-ID: <0c094a7d-25c7-4e39-7dc7-0ce7dd6dfd5c@arm.com> (raw)
In-Reply-To: <e81158a0-3a19-236a-b89f-31ddb57d42fb@palves.net>
On 10/13/22 09:44, Pedro Alves wrote:
> On 2022-10-13 8:18 a.m., Luis Machado wrote:
>> On 10/10/22 15:56, Pedro Alves wrote:
>
>>>> More recently we've added two new guesses for MVE and M-profile system registers, but it doesn't
>>>> make sense to do so, as these features are advertised as XML already.
>>>
>>> What was the justification for adding them back then, then?
>>>
>>
>> It was meant to support other register sets under a situation where no XML is sent back.
>
> Well, that's the reason for all the guesses existing. The question was more about -- why were _those_
> particular guesses needed / added? Maybe because such stubs already existed in the wild, and
> people were using some downstream patched version of GDB to work with them?
>
They weren't needed at all. mve is reported through XML by gdbserver and qemu. The system registers are only currently
supported by STLink, and that also uses XML.
>> Though valid, my feeling is that
>> it was done mostly as copy/pasting what was already being done for the GPR's/FPA. The documentation isn't exactly clear
>> on whether one should do it or not. Only a few targets use these guesses (Arm, Mips and Microblaze).
>
> It's strictly a backwards compatibility feature. It's explained in the comment:
>
Right, but since this is an old port and the background is fairly convoluted, it might be easy to miss if you
don't know some of its history. I consider the mve/system bits of the guesses dead code. Though we could argue now someone may come up with
a stub that uses mve and the system registers without XML, and that we will need to support that going forward.
I don't think that's realistic though. I hope you'll agree.
> /* 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. 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)
> {
>
> Is there something that could be improved in that comment to make it clearer?
Yes, we should put a big warning stating we should no longer update this code, until it can be dropped without
upsetting other software.
>
>> Removing the guesses doesn't buy us much on its own, but there is opportunity to get targets to move
>> to XML descriptions, which is something easier to work with, more flexible and less error-prone. So it looks
>> like a step in the right direction.
>
> The thing is that the old/existing stubs that don't send an XML don't need the flexibility. They just need
> to continue working as they do today. Removing the guesses and changing the default g/G packet layout
> causes pain to _users_ foremost. IMO, removing backwards compatibility just for the sake of it doesn't
> really help anyone.
Although that's true, it is also true that a recent-enough GDB could be used to debug those very old targets after
the compatibility layer is dropped in the future.
>
> For new registers/features, XML is how to get the flexibility. So I think the angle should be that
> we, as maintainers, should not accept adding support for more/new registers without XML tdescs.
Yes, and that's already the case.
prev parent reply other threads:[~2022-10-13 9:15 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
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 [this message]
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=0c094a7d-25c7-4e39-7dc7-0ce7dd6dfd5c@arm.com \
--to=luis.machado@arm.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@palves.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).