From: Pedro Alves <palves@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>,
Xavier Roirand <roirand@adacore.com>,
Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] (Ada) New command to stop at start of exception handler.
Date: Thu, 14 Dec 2017 15:09:00 -0000 [thread overview]
Message-ID: <1247dee1-2dd6-5cc6-576c-d555557644c8@redhat.com> (raw)
In-Reply-To: <20171214142957.ntnoteiheetx4qb2@adacore.com>
On 12/14/2017 02:29 PM, Joel Brobecker wrote:
>> > + char *info = xstrprintf (_("`%s' Ada exception hanlder"), c->excep_string);
> This line is too long.
>
>> > + struct cleanup *old_chain = make_cleanup (xfree, info);
> Let's be consistent with the above, and just do an xfree directly
> right after the call to uiout->field_string.
>
You can do:
std::string info = string_printf (_("`%s' Ada exception hanlder"),
c->excep_string);
....
uiout->text (info.c_str ());
and then you no longer have to worry about explicitly
calling xfree, or, leaking if uiout->text() throws
(which it can, if it paginates and the user aborts, for
example).
But there's also uiout->field_fmt(), which may be
better here if the field is supposed to be an MI attribute:
uiout->field_fmt ("somename",
_("`%s' Ada exception hanlder"),
c->excep_string);
Also, typo "hanlder" in format string. :-)
I haven't really read the description of the command / use case,
but this sounds very much like the existing "catch catch"?
Thanks,
Pedro Alves
next prev parent reply other threads:[~2017-12-14 15:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-12 15:57 Xavier Roirand
2017-12-14 14:30 ` Joel Brobecker
2017-12-14 15:09 ` Pedro Alves [this message]
2017-12-14 15:16 ` Joel Brobecker
2017-12-14 17:39 ` Eli Zaretskii
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=1247dee1-2dd6-5cc6-576c-d555557644c8@redhat.com \
--to=palves@redhat.com \
--cc=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=roirand@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