diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2017-09-04 10:46:36 +0200 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2017-09-04 10:46:36 +0200 |
commit | 0860c437cbe4efd8752531d0464007f448fc8274 (patch) | |
tree | 2aed7314eee9241b3b9557baa29d738a45c91973 /gdb/btrace.h | |
parent | a826403eb6f0ad2fb8c88b45ea3cf5ba39cdaa75 (diff) | |
download | gdb-0860c437cbe4efd8752531d0464007f448fc8274.zip gdb-0860c437cbe4efd8752531d0464007f448fc8274.tar.gz gdb-0860c437cbe4efd8752531d0464007f448fc8274.tar.bz2 |
btrace: Store btrace_insn in an std::vector
Because it contains a non-POD type field (flags), the type btrace_insn
should be new'ed/delete'd. Replace the VEC (btrace_insn_s) in
btrace_function with an std::vector.
gdb/ChangeLog:
* btrace.h (btrace_insn_s, DEF_VEC_O (btrace_insn_s)): Remove.
(btrace_function) <insn>: Change type to use std::vector.
* btrace.c (ftrace_debug, ftrace_call_num_insn,
ftrace_find_call, ftrace_new_gap, ftrace_update_function,
ftrace_update_insns, ftrace_compute_global_level_offset,
btrace_stitch_bts, btrace_clear, btrace_insn_get,
btrace_insn_end, btrace_insn_next, btrace_insn_prev): Adjust to
change to std::vector.
(ftrace_update_insns): Adjust to change to std::vector, change
type of INSN parameter.
(btrace_compute_ftrace_bts): Adjust call to ftrace_update_insns.
* record-btrace.c (btrace_call_history_insn_range,
btrace_compute_src_line_range,
record_btrace_frame_prev_register): Adjust to change to
std::vector.
* python/py-record-btrace.c (recpy_bt_func_instructions): Adjust
to change to std::vector.
Diffstat (limited to 'gdb/btrace.h')
-rw-r--r-- | gdb/btrace.h | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/gdb/btrace.h b/gdb/btrace.h index 9fde919..df6e895 100644 --- a/gdb/btrace.h +++ b/gdb/btrace.h @@ -81,10 +81,6 @@ struct btrace_insn btrace_insn_flags flags; }; -/* A vector of branch trace instructions. */ -typedef struct btrace_insn btrace_insn_s; -DEF_VEC_O (btrace_insn_s); - /* Flags for btrace function segments. */ enum btrace_function_flag { @@ -161,7 +157,7 @@ struct btrace_function /* The instructions in this function segment. The instruction vector will be empty if the function segment represents a decode error. */ - VEC (btrace_insn_s) *insn = NULL; + std::vector<btrace_insn> insn; /* The error code of a decode error that led to a gap. Must be zero unless INSN is empty; non-zero otherwise. */ |