This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA 3/3] Remove cleanup from print_mention_exception
- From: Tom Tromey <tom at tromey dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>
- Date: Thu, 3 May 2018 15:50:13 -0600
- Subject: [RFA 3/3] Remove cleanup from print_mention_exception
- References: <20180503215013.19891-1-tom@tromey.com>
This removes a cleanup from print_mention_exception by using
string_printf.
ChangeLog
2018-05-03 Tom Tromey <tom@tromey.com>
* ada-lang.c (print_mention_exception): Use std::string.
---
gdb/ChangeLog | 4 ++++
gdb/ada-lang.c | 8 +++-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 1af09bc00e..7cbf1ec08d 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -12805,11 +12805,9 @@ print_mention_exception (enum ada_exception_catchpoint_kind ex,
case ada_catch_exception:
if (c->excep_string != NULL)
{
- char *info = xstrprintf (_("`%s' Ada exception"), c->excep_string);
- struct cleanup *old_chain = make_cleanup (xfree, info);
-
- uiout->text (info);
- do_cleanups (old_chain);
+ std::string info = string_printf (_("`%s' Ada exception"),
+ c->excep_string);
+ uiout->text (info.c_str ());
}
else
uiout->text (_("all Ada exceptions"));
--
2.13.6