From: Nicholas Kulikov <nkulikov@gmail.com>
To: gdb@sourceware.org
Subject: tdesc_get_features_xml() logic
Date: Wed, 26 Jan 2022 10:30:33 +0300 [thread overview]
Message-ID: <CAOOM2W1kxEx0DWfj0fe2PNzRjxZK8mnhfWApSoMRKtVRGT74=g@mail.gmail.com> (raw)
Hello,
What is the idea to check the precondition `tdesc->xmltarget != NULL`
in assert while there is (the code below) conditional logic which
handles this case? Do I miss something or there is a flaw in assert
logic?
gdbserver/tdesc.cc:
const char *
tdesc_get_features_xml (const target_desc *tdesc)
{
/* Either .xmltarget or .features is not NULL. */
gdb_assert (tdesc->xmltarget != NULL
|| (!tdesc->features.empty ()
&& tdesc->arch != NULL));
if (tdesc->xmltarget == NULL)
{
std::string buffer ("@");
print_xml_feature v (&buffer);
tdesc->accept (v);
tdesc->xmltarget = xstrdup (buffer.c_str ());
}
return tdesc->xmltarget;
}
This assert triggered at first call of tdesc_get_features_xml() when
tdesc->xmltarget is NULL.
next reply other threads:[~2022-01-26 7:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 7:30 Nicholas Kulikov [this message]
2022-01-26 7:42 ` Joel Brobecker
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='CAOOM2W1kxEx0DWfj0fe2PNzRjxZK8mnhfWApSoMRKtVRGT74=g@mail.gmail.com' \
--to=nkulikov@gmail.com \
--cc=gdb@sourceware.org \
/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).