C++-ify varobj iteration
authorTom Tromey <tom@tromey.com>
Fri, 11 Dec 2020 16:33:36 +0000 (09:33 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 11 Dec 2020 16:33:38 +0000 (09:33 -0700)
commit54746ce37a483e235ac128b6f545be9888bf3521
tree00098f97c2514f9895f1e7bab52678ed4dba9dee
parentd8f168ddd08f1d5fde1a193724cdc40d524039a7
C++-ify varobj iteration

This changes the varobj iteration code to use a C++ class rather than
a C struct with a separate "ops" structure.  The only implementation
is updated to use inheritance.  This simplifies the code quite nicely.

gdb/ChangeLog
2020-12-11  Tom Tromey  <tom@tromey.com>

* varobj.c (update_dynamic_varobj_children, install_visualizer)
(varobj::~varobj): Update.
* varobj-iter.h (struct varobj_iter): Change to interface class.
(struct varobj_iter_ops): Remove.
(varobj_iter_next, varobj_iter_delete): Remove.
* python/py-varobj.c (struct py_varobj_iter): Derive from
varobj_iter.  Add constructor, destructor.  Rename members.
(py_varobj_iter::~py_varobj_iter): Rename from
py_varobj_iter_dtor.
(py_varobj_iter::next): Rename from py_varobj_iter_next.
(py_varobj_iter_ops): Remove.
(py_varobj_iter): Rename from py_varobj_iter_ctor.
(py_varobj_iter_new): Remove.
(py_varobj_get_iterator): Update.
gdb/ChangeLog
gdb/python/py-varobj.c
gdb/varobj-iter.h
gdb/varobj.c