+2017-11-04 Tom Tromey <tom@tromey.com>
+
+ * c-typeprint.c (c_type_print_base): Use gdb::unique_xmalloc_ptr.
+
2017-11-04 Tom Tromey <tom@tromey.com>
* linux-tdep.c (linux_core_info_proc_mappings): Use
for (j = 0; j < len2; j++)
{
const char *mangled_name;
+ gdb::unique_xmalloc_ptr<char> mangled_name_holder;
char *demangled_name;
- struct cleanup *inner_cleanup;
const char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
int is_full_physname_constructor =
TYPE_FN_FIELD_CONSTRUCTOR (f, j)
if (TYPE_FN_FIELD_ARTIFICIAL (f, j))
continue;
- inner_cleanup = make_cleanup (null_cleanup, NULL);
-
QUIT;
section_type = output_access_specifier
(stream, section_type, level,
}
if (TYPE_FN_FIELD_STUB (f, j))
{
- char *tem;
-
/* Build something we can demangle. */
- tem = gdb_mangle_name (type, i, j);
- make_cleanup (xfree, tem);
- mangled_name = tem;
+ mangled_name_holder.reset (gdb_mangle_name (type, i, j));
+ mangled_name = mangled_name_holder.get ();
}
else
mangled_name = TYPE_FN_FIELD_PHYSNAME (f, j);
xfree (demangled_name);
}
- do_cleanups (inner_cleanup);
-
fprintf_filtered (stream, ";\n");
}
}