diff options
author | Tom Tromey <tromey@adacore.com> | 2019-08-06 13:50:03 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2019-08-07 06:37:21 -0600 |
commit | 123cd851480c728845a4c3f85da772dd8331cf19 (patch) | |
tree | 1ecc475ebe4da5ade1fd9e0219bcaafd567f11ad /gdb/mi/mi-cmd-stack.c | |
parent | 3d31bc39e655ea39721754fa0ea539a8a0c9b26c (diff) | |
download | gdb-123cd851480c728845a4c3f85da772dd8331cf19.zip gdb-123cd851480c728845a4c3f85da772dd8331cf19.tar.gz gdb-123cd851480c728845a4c3f85da772dd8331cf19.tar.bz2 |
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.
Diffstat (limited to 'gdb/mi/mi-cmd-stack.c')
-rw-r--r-- | gdb/mi/mi-cmd-stack.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index e8f8d15..7a3ba47 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -533,7 +533,7 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what, if (arg->val || arg->error) { if (arg->error) - stb.printf (_("<error reading variable: %s>"), arg->error); + stb.printf (_("<error reading variable: %s>"), arg->error.get ()); else { try @@ -641,10 +641,8 @@ list_args_or_locals (const frame_print_options &fp_opts, sym2 = sym; gdb_assert (sym2 != NULL); - memset (&arg, 0, sizeof (arg)); arg.sym = sym2; arg.entry_kind = print_entry_values_no; - memset (&entryarg, 0, sizeof (entryarg)); entryarg.sym = sym2; entryarg.entry_kind = print_entry_values_no; @@ -669,8 +667,6 @@ list_args_or_locals (const frame_print_options &fp_opts, list_arg_or_local (&arg, what, values, skip_unavailable); if (entryarg.entry_kind != print_entry_values_no) list_arg_or_local (&entryarg, what, values, skip_unavailable); - xfree (arg.error); - xfree (entryarg.error); } } |