Use std::vector on tdesc->reg_defs (gdbserver/tdesc.h)
authorSergio Durigan Junior <sergiodj@redhat.com>
Sun, 10 Sep 2017 16:17:18 +0000 (12:17 -0400)
committerSergio Durigan Junior <sergiodj@redhat.com>
Sat, 16 Sep 2017 03:51:33 +0000 (23:51 -0400)
commitc4dfafabc575f4995a5aa18241adc275e63c846c
tree0f9602ece012d0f7cf1322514adb171089894c4e
parentebee3285b3a44ef2854e9ec84a0c92f5cca4da68
Use std::vector on tdesc->reg_defs (gdbserver/tdesc.h)

This is a followup patch to the build breakage fix on AArch64.  While
doing the fix, I found it better to convert tdesc->reg_defs (on
gdbserver/tdesc.h) from using VEC to using std::vector.  This makes
the code easier to read and maintain, and also is one more step
towards the C++fication.

Regtested on BuildBot.

2017-09-16  Sergio Durigan Junior  <sergiodj@redhat.com>

* regcache.c (get_thread_regcache): Update code to use "std::vector"
instead of "VEC" for "target_desc.reg_defs".
(regcache_cpy): Likewise.
(registers_to_string): Likewise.
(registers_from_string): Likewise.
(find_regno): Likewise.
(supply_regblock): Likewise.
(regcache_raw_read_unsigned): Likewise.
* tdesc.c (init_target_desc): Likewise.
(tdesc_create_reg): Likewise.
* tdesc.h: Remove declaration of "tdesc_reg_p".  Include <vector>.
(struct target_desc) <reg_defs>: Convert to "std::vector".
(target_desc): Do not initialize "reg_defs".
(~target_desc): Update code to use "std::vector" instead of "VEC"
for "target_desc.reg_defs".
(operator==): Likewise.
gdb/gdbserver/ChangeLog
gdb/gdbserver/regcache.c
gdb/gdbserver/tdesc.c
gdb/gdbserver/tdesc.h