diff options
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 381752bab74..502710a462f 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -7602,17 +7602,11 @@ ada_value_struct_elt (struct value *arg, char *name, int no_err) static std::string type_as_string (struct type *type) { - struct ui_file *tmp_stream = mem_fileopen (); - struct cleanup *old_chain; - - tmp_stream = mem_fileopen (); - old_chain = make_cleanup_ui_file_delete (tmp_stream); + string_file tmp_stream; - type_print (type, "", tmp_stream, -1); - std::string str = ui_file_as_string (tmp_stream); + type_print (type, "", &tmp_stream, -1); - do_cleanups (old_chain); - return str; + return std::move (tmp_stream.string ()); } /* Given a type TYPE, look up the type of the component of type named NAME. |