aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracefile-tfile.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2017-10-14 08:42:23 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2017-10-14 08:42:23 -0400
commitd0d292a27402ee2d3f91d541371f134f91730373 (patch)
tree568c3ca6c82a57938d94c7e496b867ce2bdd2578 /gdb/tracefile-tfile.c
parent8d3c73ef6b1aff1b22296bd48ec302b4b1d4808c (diff)
downloadgdb-d0d292a27402ee2d3f91d541371f134f91730373.zip
gdb-d0d292a27402ee2d3f91d541371f134f91730373.tar.gz
gdb-d0d292a27402ee2d3f91d541371f134f91730373.tar.bz2
Use std::vector for traceframe_info::tvars
Straightforward change to get rid of a VEC. We need to new/delete traceframe_info instead of malloc/free it. I found three places that allocate a traceframe_info (ctf_traceframe_info, tfile_traceframe_info and parse_traceframe_info) and only one that frees it (free_traceframe_info). gdb/ChangeLog: * tracepoint.h (struct traceframe_info) <tvars>: Change type to std::vector<int>. * tracepoint.c (free_traceframe_info): Deallocate with delete. (traceframe_info_start_tvar): Adjust to vector change. (parse_traceframe_info): Allocate with new. * ctf.c (ctf_traceframe_info): Allocate with new, adjust to vector change. * tracefile-tfile.c (build_traceframe_info): Adjust to vector change. tfile_traceframe_info): Allocate with new. * mi/mi-main.c (mi_cmd_trace_frame_collected): Adjust to vector change.
Diffstat (limited to 'gdb/tracefile-tfile.c')
-rw-r--r--gdb/tracefile-tfile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c
index 7288e7c..0075581 100644
--- a/gdb/tracefile-tfile.c
+++ b/gdb/tracefile-tfile.c
@@ -1075,7 +1075,7 @@ build_traceframe_info (char blocktype, void *data)
int vnum;
tfile_read ((gdb_byte *) &vnum, 4);
- VEC_safe_push (int, info->tvars, vnum);
+ info->tvars.push_back (vnum);
}
case 'R':
case 'S':
@@ -1095,7 +1095,7 @@ build_traceframe_info (char blocktype, void *data)
static struct traceframe_info *
tfile_traceframe_info (struct target_ops *self)
{
- struct traceframe_info *info = XCNEW (struct traceframe_info);
+ traceframe_info *info = new traceframe_info;
traceframe_walk_blocks (build_traceframe_info, 0, info);
return info;