Make struct frame_arg self-managing

This changes struct frame_arg to be self-managing and then fixes the
various users.

Tested by the buildbot.

gdb/ChangeLog
2019-08-07  Tom Tromey  <tromey@adacore.com>

	* stack.c (print_frame_arg, read_frame_local, read_frame_arg)
	(print_frame_args): Update.
	* python/py-framefilter.c (py_print_single_arg, enumerate_args):
	Update.
	* mi/mi-cmd-stack.c (list_arg_or_local): Update.
	* frame.h (struct frame_arg): Add initializers.
	<error>: Now a unique_xmalloc_ptr.
This commit is contained in:
Tom Tromey
2019-08-06 13:50:03 -06:00
parent 3d31bc39e6
commit 123cd85148
5 changed files with 22 additions and 25 deletions

View File

@ -398,7 +398,7 @@ py_print_single_arg (struct ui_out *out,
gdb_assert (fa != NULL && fa->error != NULL);
out->field_fmt ("value",
_("<error reading variable: %s>"),
fa->error);
fa->error.get ());
}
else
py_print_value (out, val, opts, 0, args_type, language);
@ -486,9 +486,6 @@ enumerate_args (PyObject *iter,
read_frame_arg (user_frame_print_options,
sym, frame, &arg, &entryarg);
gdb::unique_xmalloc_ptr<char> arg_holder (arg.error);
gdb::unique_xmalloc_ptr<char> entry_holder (entryarg.error);
/* The object has not provided a value, so this is a frame
argument to be read by GDB. In this case we have to
account for entry-values. */