Replace VEC (varobj_update_result) with 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)
commit0604393c22f626f26b5a4a30e57da40404f5aa5e
tree9c0975d7db4c7d18f7a5a23816ac31b683e7dfb2
parentddf0ea085b626ddcbb14f88f495bcb677b7ab6e9
Replace VEC (varobj_update_result) with std::vector

This patch replaces makes varobj_update return an std::vector, and
updates the fallouts.

To make that easier, the varobj_update_result is c++ified a bit.  I
added a constructor and initialized its fields in-class.  The newobj
vector is also made an std::vector, so that it's automatically freed
when varobj_update_result is destroyed and handled correctly by the
default move constructor.  I disabled copy constructor and assignment
for that structure, because normally it never needs to be copied, only
moved.

As a result, the newobj parameter of update_dynamic_varobj_children must
be changed to an std::vector.  The patch converts the other vector
parameters of update_dynamic_varobj_children to std::vector.  It's not
strictly necessary to do it in the same patch, but I think it makes
sense to do it.

gdb/ChangeLog:

* varobj.h (struct varobj_update_result): Add constructor, add
move constructor, disable copy and assign, initialize fields.
<newobj>: Change type to std::vector.
(varobj_update): Return std::vector.
* varobj.c (install_dynamic_child): Change VEC parameters to
std::vector and adjust.
(update_dynamic_varobj_children): Likewise.
(varobj_update): Return std::vector and adjust.
* mi/mi-cmd-var.c (varobj_update_one): Adjust to vector changes.
gdb/ChangeLog
gdb/mi/mi-cmd-var.c
gdb/varobj.c
gdb/varobj.h
This page took 0.025948 seconds and 4 git commands to generate.