+2017-09-25 Tom Tromey <tom@tromey.com>
+
+ * regcache.c (regcache::dump): Use string_printf.
+
2017-09-25 Tom Tromey <tom@tromey.com>
* regcache.c (class regcache_invalidator): New.
void
regcache::dump (ui_file *file, enum regcache_dump_what what_to_dump)
{
- struct cleanup *cleanups = make_cleanup (null_cleanup, NULL);
struct gdbarch *gdbarch = m_descr->gdbarch;
int regnum;
int footnote_nr = 0;
/* Type. */
{
const char *t;
+ std::string name_holder;
if (regnum < 0)
t = "Type";
t = TYPE_NAME (register_type (arch (), regnum));
if (t == NULL)
{
- char *n;
-
if (!footnote_register_type_name_null)
footnote_register_type_name_null = ++footnote_nr;
- n = xstrprintf ("*%d", footnote_register_type_name_null);
- make_cleanup (xfree, n);
- t = n;
+ name_holder = string_printf ("*%d",
+ footnote_register_type_name_null);
+ t = name_holder.c_str ();
}
/* Chop a leading builtin_type. */
if (startswith (t, blt))
fprintf_unfiltered (file,
"*%d: Register type's name NULL.\n",
footnote_register_type_name_null);
- do_cleanups (cleanups);
}
static void