From: Alan Hayward <Alan.Hayward@arm.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
nd <nd@arm.com>
Subject: Re: [PATCH] Allow osabi to be optional in target descriptors
Date: Thu, 16 Nov 2017 10:07:00 -0000 [thread overview]
Message-ID: <71081D3D-57E8-43DC-908A-891E7ADB92C7@arm.com> (raw)
In-Reply-To: <864lputwf1.fsf@gmail.com>
> On 16 Nov 2017, at 09:17, Yao Qi <qiyaoltc@gmail.com> wrote:
>
> Alan Hayward <Alan.Hayward@arm.com> writes:
>
> Patch is good to me, some nits on commit log and code,
>
>> Osabi is an option field in target descriptors, according to:
>
> s/target descriptors/target descriptions/
>
>> https://sourceware.org/gdb/current/onlinedocs/gdb/Target-Description-Format.html
>>
>> However, removing the osabi field from the i386 and amd64 target descriptors
>
> Likewise.
>
>>
>> The following patch fixes this error.
>>
>> Tested with gdbserver on x86 and also on aarch64 with my target descriptor patch.
>
> Likewise.
>
>> @@ -105,9 +104,12 @@ tdesc_get_features_xml (target_desc *tdesc)
>> buffer += tdesc->arch;
>> buffer += "</architecture>";
>>
>> - buffer += "<osabi>";
>> - buffer += tdesc->osabi;
>> - buffer += "</osabi>";
>> + if (tdesc->osabi != NULL)
>
> As we are in C++, I prefer nullptr.
>
> s/NULL/nullptr/
>
Thanks.
Pushed with changes as above.
diff --git a/gdb/gdbserver/tdesc.c b/gdb/gdbserver/tdesc.c
index 63d6467d56d168777f4fa39b56495dd5649c046b..e2c4288efba1546247a3b376da3c573c223b6eef 100644
--- a/gdb/gdbserver/tdesc.c
+++ b/gdb/gdbserver/tdesc.c
@@ -92,8 +92,7 @@ tdesc_get_features_xml (target_desc *tdesc)
/* Either .xmltarget or .features is not NULL. */
gdb_assert (tdesc->xmltarget != NULL
|| (tdesc->features != NULL
- && tdesc->arch != NULL
- && tdesc->osabi != NULL));
+ && tdesc->arch != NULL));
if (tdesc->xmltarget == NULL)
{
@@ -105,9 +104,12 @@ tdesc_get_features_xml (target_desc *tdesc)
buffer += tdesc->arch;
buffer += "</architecture>";
- buffer += "<osabi>";
- buffer += tdesc->osabi;
- buffer += "</osabi>";
+ if (tdesc->osabi != nullptr)
+ {
+ buffer += "<osabi>";
+ buffer += tdesc->osabi;
+ buffer += "</osabi>";
+ }
char *xml;
prev parent reply other threads:[~2017-11-16 10:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-16 8:09 Alan Hayward
2017-11-16 9:17 ` Yao Qi
2017-11-16 10:07 ` Alan Hayward [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=71081D3D-57E8-43DC-908A-891E7ADB92C7@arm.com \
--to=alan.hayward@arm.com \
--cc=gdb-patches@sourceware.org \
--cc=nd@arm.com \
--cc=qiyaoltc@gmail.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