Use std::vector for traceframe_info::tvars
authorSimon Marchi <simon.marchi@polymtl.ca>
Sat, 14 Oct 2017 12:42:23 +0000 (08:42 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Sat, 14 Oct 2017 12:42:23 +0000 (08:42 -0400)
commitd0d292a27402ee2d3f91d541371f134f91730373
tree568c3ca6c82a57938d94c7e496b867ce2bdd2578
parent8d3c73ef6b1aff1b22296bd48ec302b4b1d4808c
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.
gdb/ChangeLog
gdb/ctf.c
gdb/mi/mi-main.c
gdb/tracefile-tfile.c
gdb/tracepoint.c
gdb/tracepoint.h