Remove cleanups from link_callbacks_einfo
authorTom Tromey <tom@tromey.com>
Wed, 25 Oct 2017 21:44:56 +0000 (15:44 -0600)
committerTom Tromey <tom@tromey.com>
Sat, 4 Nov 2017 16:27:15 +0000 (10:27 -0600)
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.

gdb/ChangeLog
gdb/compile/compile-object-load.c

index f7d821c1e27055c584195406d998c314877a212a..af1ef2489e637297177ba7a546012dc066979dd9 100644 (file)
@@ -1,3 +1,8 @@
+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):
index 41d5fc347fb7a55687c38d554bfe26c091f58920..8e55d3c2c9f22ab7b6132a6e9ecf4b1a519e3e9e 100644 (file)
@@ -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.
This page took 0.032166 seconds and 4 git commands to generate.