This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/4] Use flexible target descriptors for aarch64
- From: Alan Hayward <Alan dot Hayward at arm dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Mon, 6 Nov 2017 12:57:54 +0000
- Subject: Re: [PATCH 3/4] Use flexible target descriptors for aarch64
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan dot Hayward at arm dot com;
- Nodisclaimer: True
- References: <B5844492-E88D-4024-AF89-34BFB38E1CE8@arm.com> <86h8ugyenj.fsf@gmail.com> <A0F02AC1-8FF2-4022-B089-F68D2949CEB6@arm.com> <8EE70574-8937-414B-9903-0E427D388B07@arm.com> <86a7zzwrs5.fsf@gmail.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
> On 6 Nov 2017, at 11:49, Yao Qi <qiyaoltc@gmail.com> wrote:
>
> Alan Hayward <Alan.Hayward@arm.com> writes:
>
>> In the existing code, osabi is never set for aarch64 - the osabi line is missing
>> from the .xml files. Some other architectures set to “GNU/Linux”. I assumed
>> there was a reason aarch64 didn’t do this. I didn’t want to change
>> this behaviour,
>
> Agreed, it should be a separated patch to address this, if needed. See
> PR 19895 "gdbserver target description on aarch64/arm doesn't specify osabi"
>
>> so instead in my code osabi is set to “”.
>
> However, setting osabi to "" in GDBserver may slightly change the
> the XML content GDB received from GDBserver. Without your changes, the
> XML contents received from GDBserver doesn't have "<osabi>XXX</osabi>",
> however with your changes, the XML contents have "<osabi></osabi>". Can
> you confirm this? The change like this doesn't affect any GDB's
> behavior, because osabi in GDB side is still GDB_OSABI_UNKNOWN.
>
> On the other hand, "osabi" is an optional field,
> https://sourceware.org/gdb/current/onlinedocs/gdb/Target-Description-Format.html
> so it is optional in "tdesc" too. IMO, we need to remove
> "tdesc->osabi != NULL" from the assert, and let GDBserver only generate
> "<osabi>XXX</osabi>" when tdesc->osabi isn't NULL. What do you think?
>
Given that osabi is optional, it makes sense to me that it should be removed from
the assert.
Setting to “” feels a bit of a hack.
Alan.