aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-09-16 09:12:27 -0400
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-10-02 14:05:49 +0100
commit46f29a9a260da1a03176682aff63bad03d8f2e8b (patch)
tree4fd2bb40deed8e0e8b6745bd2c6f70bab02347d0 /gdb/gdbserver
parentde4859eacb74a440d9fd61e4a0f051e3737a05dd (diff)
downloadgdb-46f29a9a260da1a03176682aff63bad03d8f2e8b.zip
gdb-46f29a9a260da1a03176682aff63bad03d8f2e8b.tar.gz
gdb-46f29a9a260da1a03176682aff63bad03d8f2e8b.tar.bz2
gdb: Remove a VEC from gdbsupport/btrace-common.h
Converts a VEC into a std::vector in gdbsupport/btrace-common.h. This commit just performs a mechanical conversion and doesn't do any refactoring. One consequence of this is that the std::vector must actually be a pointer to std::vector as it is placed within a union. It might be possible in future to refactor to a class hierarchy and remove the need for a union, but I'd rather have that be a separate change to make it easier to see the evolution of the code. gdb/ChangeLog: * btrace.c (btrace_compute_ftrace_bts): Update for std::vector, make accesses into the vector constant references. (btrace_add_pc): Update for std::vector. (btrace_stitch_bts): Likewise. (parse_xml_btrace_block): Likewise. (btrace_maint_update_packets): Likewise. (btrace_maint_print_packets): Likewise. (maint_info_btrace_cmd): Likewise. * gdbsupport/btrace-common.c (btrace_data::fini): Update for std::vector. (btrace_data::empty): Likewise. (btrace_data_append): Likewise. * gdbsupport/btrace-common.h: Remove use of DEF_VEC_O. (typedef btrace_block_s): Delete. (struct btrace_block): Add constructor. (struct btrace_data_bts) <blocks>: Change to std::vector. * nat/linux-btrace.c (perf_event_read_bts): Update for std::vector. (linux_read_bts): Likewise. gdb/gdbserver/ChangeLog: * linux-low.c (linux_low_read_btrace): Update for change to std::vector.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog5
-rw-r--r--gdb/gdbserver/linux-low.c8
2 files changed, 7 insertions, 6 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index c0c6f51..7eef2c5 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2019-10-02 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * linux-low.c (linux_low_read_btrace): Update for change to
+ std::vector.
+
2019-09-20 Christian Biesinger <cbiesinger@google.com>
* debug.c (debug_threads): Remove comment in favor of the header.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index d64c364..0e4b14e 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -7115,9 +7115,7 @@ linux_low_read_btrace (struct btrace_target_info *tinfo, struct buffer *buffer,
enum btrace_read_type type)
{
struct btrace_data btrace;
- struct btrace_block *block;
enum btrace_error err;
- int i;
err = linux_read_btrace (&btrace, tinfo, type);
if (err != BTRACE_ERR_NONE)
@@ -7140,11 +7138,9 @@ linux_low_read_btrace (struct btrace_target_info *tinfo, struct buffer *buffer,
buffer_grow_str (buffer, "<!DOCTYPE btrace SYSTEM \"btrace.dtd\">\n");
buffer_grow_str (buffer, "<btrace version=\"1.0\">\n");
- for (i = 0;
- VEC_iterate (btrace_block_s, btrace.variant.bts.blocks, i, block);
- i++)
+ for (const btrace_block &block : *btrace.variant.bts.blocks)
buffer_xml_printf (buffer, "<block begin=\"0x%s\" end=\"0x%s\"/>\n",
- paddress (block->begin), paddress (block->end));
+ paddress (block.begin), paddress (block.end));
buffer_grow_str0 (buffer, "</btrace>\n");
break;