This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Remove cleanups from link_callbacks_einfo
- From: Tom Tromey <tromey at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 4 Nov 2017 16:38:00 -0000
- Subject: [binutils-gdb] Remove cleanups from link_callbacks_einfo
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=20dcd8cae7d87910f6c3936bad72e78b647a8de6
commit 20dcd8cae7d87910f6c3936bad72e78b647a8de6
Author: Tom Tromey <tom@tromey.com>
Date: Wed Oct 25 15:44:56 2017 -0600
Remove cleanups from link_callbacks_einfo
This removes a cleanup from link_callbacks_einfo by using std::string.
gdb/ChangeLog
2017-11-04 Tom Tromey <tom@tromey.com>
* compile/compile-object-load.c (link_callbacks_einfo): Use
std::string.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/compile/compile-object-load.c | 9 ++-------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f7d821c..af1ef24 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2017-11-04 Tom Tromey <tom@tromey.com>
+ * compile/compile-object-load.c (link_callbacks_einfo): Use
+ std::string.
+
+2017-11-04 Tom Tromey <tom@tromey.com>
+
* dwarf2read.c (process_full_comp_unit, process_full_type_unit):
Use scoped_free_pendings.
* dbxread.c (dbx_symfile_read, dbx_psymtab_to_symtab_1): Use
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index 41d5fc3..8e55d3c 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.