From: Andrew Burgess <aburgess@redhat.com>
To: Tom Tromey <tromey@adacore.com>
Cc: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org>,
Tom Tromey <tromey@adacore.com>
Subject: Re: [PATCH] Do not record a rejected target description
Date: Wed, 15 Feb 2023 12:56:32 +0000 [thread overview]
Message-ID: <875yc3m6in.fsf@redhat.com> (raw)
In-Reply-To: <875yc4tawn.fsf@tromey.com>
Tom Tromey <tromey@adacore.com> writes:
>>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
>
>>> info.target_desc = tdesc_info->tdesc;
>>> if (!gdbarch_update_p (info))
>>> - warning (_("Architecture rejected target-supplied description"));
>>> + {
>>> + warning (_("Architecture rejected target-supplied description"));
>>> + tdesc_info->tdesc = nullptr;
>>> + }
>
> Andrew> This seems fine, but it is possible that an exception could take us out
> Andrew> of this function too, for example, a misbehaving remote target can cause
> Andrew> target_read_description_xml to throw an exception. I guess that any of
> Andrew> the issues you were originally seeing would also trigger if we throw an
> Andrew> exception.
>
> I don't think this can really happen, because that call is part of the
> assignment to the field in question:
>
> if (tdesc_info->tdesc == nullptr)
> tdesc_info->tdesc = target_read_description
> (current_inferior ()->top_target ());
>
> So, if it does throw, the tdesc_info won't be updated.
You are, of course, correct. I guess given we know nothing after the
assignment can throw the what you have is fine. Hopefully we'll not add
an error() call later.
Sorry for the noise.
Andrew
next prev parent reply other threads:[~2023-02-15 12:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-12 19:33 Tom Tromey
2023-02-14 15:16 ` Tom Tromey
2023-02-14 15:48 ` Andrew Burgess
2023-02-14 17:27 ` Tom Tromey
2023-02-15 12:56 ` Andrew Burgess [this message]
2023-02-15 15:59 ` Tom Tromey
2023-02-15 21:19 ` Simon Marchi
2023-02-15 21:38 ` Tom Tromey
2023-02-16 19:20 ` Tom Tromey
2023-02-16 19:33 ` Simon Marchi
2023-02-17 10:19 ` Andrew Burgess
2023-02-17 14:09 ` Tom Tromey
2023-02-17 22:29 ` Andrew Burgess
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=875yc3m6in.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).