aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-02-26 14:59:47 -0700
committerTom Tromey <tromey@adacore.com>2019-03-05 08:48:40 -0700
commit895dafa679db7af79576dcd177a6d91d65657ee8 (patch)
treeff0395477787a0b1b5f432866f3428e9edbf40e5 /gdb/varobj.c
parent88a774b9984e42c492ddcf4e4b4b0170ac803576 (diff)
downloadgdb-895dafa679db7af79576dcd177a6d91d65657ee8.zip
gdb-895dafa679db7af79576dcd177a6d91d65657ee8.tar.gz
gdb-895dafa679db7af79576dcd177a6d91d65657ee8.tar.bz2
Add ATTRIBUTE_UNUSED_RESULT to ref_ptr::release
This applies ATTRIBUTE_UNUSED_RESULT to ref_ptr::release and updates a few spots to comply. I believe one use in install_default_visualizer was in error, fixed by this patch. gdb/ChangeLog 2019-03-05 Tom Tromey <tromey@adacore.com> * varobj.c (update_dynamic_varobj_children): Update. (install_default_visualizer): Use reset, not release. * value.c (set_internalvar): Update. * dwarf2loc.c (value_of_dwarf_reg_entry): Update. * common/gdb_ref_ptr.h (class ref_ptr) <release>: Add ATTRIBUTE_UNUSED_RESULT.
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index b033070..3715bb6 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -760,7 +760,7 @@ update_dynamic_varobj_children (struct varobj *var,
/* Release vitem->value so its lifetime is not bound to the
execution of a command. */
if (item != NULL && item->value != NULL)
- release_value (item->value).release ();
+ item->value = release_value (item->value).release ();
}
if (item == NULL)
@@ -1127,7 +1127,7 @@ install_default_visualizer (struct varobj *var)
}
if (pretty_printer == Py_None)
- pretty_printer.release ();
+ pretty_printer.reset (nullptr);
install_visualizer (var->dynamic, NULL, pretty_printer.release ());
}