"wchar_t", NULL, 0);
int wcwidth = TYPE_LENGTH (wctype);
gdb_byte *buf = (gdb_byte *) alloca (wcwidth);
- struct obstack output;
- struct cleanup *inner_cleanup;
tem = value_as_address (value);
read_memory (tem, str, j);
memset (&str[j], 0, wcwidth);
- obstack_init (&output);
- inner_cleanup = make_cleanup_obstack_free (&output);
+ auto_obstack output;
convert_between_encodings (target_wide_charset (gdbarch),
host_charset (),
obstack_grow_str0 (&output, "");
fprintf_filtered (stream, format, obstack_base (&output));
- do_cleanups (inner_cleanup);
}
/* Subroutine of ui_printf to simplify it.
struct type *wctype = lookup_typename (current_language, gdbarch,
"wchar_t", NULL, 0);
struct type *valtype;
- struct obstack output;
- struct cleanup *inner_cleanup;
const gdb_byte *bytes;
valtype = value_type (val_args[i]);
bytes = value_contents (val_args[i]);
- obstack_init (&output);
- inner_cleanup = make_cleanup_obstack_free (&output);
+ auto_obstack output;
convert_between_encodings (target_wide_charset (gdbarch),
host_charset (),
fprintf_filtered (stream, current_substring,
obstack_base (&output));
- do_cleanups (inner_cleanup);
}
break;
case double_arg: