This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA 02/13] Remove cleanups from link_callbacks_einfo
- 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, 2 Nov 2017 16:36:01 -0600
- Subject: [RFA 02/13] Remove cleanups from link_callbacks_einfo
- Authentication-results: sourceware.org; auth=none
- References: <20171102223612.3642-1-tom@tromey.com>
This removes a cleanup from link_callbacks_einfo by using std::string.
gdb/ChangeLog
2017-11-02 Tom Tromey <tom@tromey.com>
* compile/compile-object-load.c (link_callbacks_einfo): Use
std::string.
---
gdb/ChangeLog | 5 +++++
gdb/compile/compile-object-load.c | 9 ++-------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index 41d5fc347f..8e55d3c2c9 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -281,18 +281,13 @@ static void link_callbacks_einfo (const char *fmt, ...)
static void
link_callbacks_einfo (const char *fmt, ...)
{
- struct cleanup *cleanups;
va_list ap;
- char *str;
va_start (ap, fmt);
- str = xstrvprintf (fmt, ap);
+ std::string str = string_vprintf (fmt, ap);
va_end (ap);
- cleanups = make_cleanup (xfree, str);
-
- warning (_("Compile module: warning: %s"), str);
- do_cleanups (cleanups);
+ warning (_("Compile module: warning: %s"), str.c_str ());
}
/* Helper for bfd_get_relocated_section_contents.
--
2.13.6