Make varobj::children an std::vector
authorSimon Marchi <simon.marchi@polymtl.ca>
Wed, 22 Nov 2017 20:08:06 +0000 (15:08 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Wed, 22 Nov 2017 20:08:06 +0000 (15:08 -0500)
commitddf0ea085b626ddcbb14f88f495bcb677b7ab6e9
tree23357c4c7097c35cc21f9baba5c13f3d3ed57cee
parent9e5b9d2b295d1771647a9e4bc942e398142ccf9b
Make varobj::children an std::vector

This patch makes the children field of varobj an std::vector, and
updates the fallout.

One note is that varobj::parent must be made non-const.  The reason is
that when a child deletes itself, it modifies its writes NULL to its
slot in its parent's children vector.  With the VEC, the const didn't
made the parent's children vector content const, only the pointer to it,
but with std::vector, even the content is.

gdb/ChangeLog:

* varobj.h (struct varobj) <parent>: Remove const.
<children>: Change type to std::vector.
(varobj_list_children): Return std::vector const reference.
(varobj_restrict_range): Change parameter type to std::vector
const reference.
* varobj.c (varobj_has_more): Adjust.
(varobj_restrict_range): Change parameter type to std::vector
const reference and adjust.
(install_dynamic_child): Adjust.
(update_dynamic_varobj_children): Adjust.
(varobj_list_children): Return std::vector const reference and
adjust.
(varobj_add_child): Adjust.
(update_type_if_necessary): Adjust.
(varobj_update): Adjust.
(delete_variable_1): Adjust.
* ada-varobj.c (ada_value_has_mutated): Adjust.
* mi/mi-cmd-var.c (mi_cmd_var_list_children): Adjust.
gdb/ChangeLog
gdb/ada-varobj.c
gdb/mi/mi-cmd-var.c
gdb/varobj.c
gdb/varobj.h
This page took 0.026903 seconds and 4 git commands to generate.