[PATCHv3 0/3] Remove some uses of VEC

Andrew Burgess
2019-09-26T00:00:10Z

Tom raised some good points about patch #3, specifically that some of
the query functions like VEC_length and VEC_empty will return a sane
answer even when the vector pointer is NULL. He also pointed out that
VEC_free resets theh vector pointer back to NULL.

This revision of the series is a little more defensive about checking
for the std::vector pointer being null before dereferencing it. In
places where I'm reasonably sure the vector pointer won't be NULL I've
added an assert - then at least if I'm wrong we'll get a nice error
rather than a random crash.

Thanks,
Andrew

---

Andrew Burgess (3):
gdb: Remove a VEC from gdbsupport/btrace-common.h
gdb: Change a VEC to std::vector in btrace.{c,h}
gdb: Remove a use of VEC from dwarf2read.{c,h}

gdb/ChangeLog | 46 ++++++++++++++++++++
gdb/btrace.c | 98 ++++++++++++++++++++----------------------
gdb/btrace.h | 5 +--
gdb/dwarf2read.c | 17 ++++----
gdb/dwarf2read.h | 3 --
gdb/gdbserver/ChangeLog | 5 +++
gdb/gdbserver/linux-low.c | 8 +---
gdb/gdbsupport/btrace-common.c | 20 ++++-----
gdb/gdbsupport/btrace-common.h | 19 ++++----
gdb/nat/linux-btrace.c | 16 +++----
10 files changed, 139 insertions(+), 98 deletions(-)

--
2.14.5