Re: [PATCH 3/4] Use flexible target descriptors for aarch64

Alan Hayward
2017-11-06T12:58:02Z

> 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.