diff options
author | Tim Wiederhake <tim.wiederhake@intel.com> | 2017-05-30 12:47:37 +0200 |
---|---|---|
committer | Tim Wiederhake <tim.wiederhake@intel.com> | 2017-05-30 12:49:25 +0200 |
commit | 2b51eddc5503ea84d48c5b3b3ec3388eba440451 (patch) | |
tree | 5e46647cbf2fcfb71e0c57491a0fdbf2d4fc1878 /gdb/btrace.c | |
parent | 70c16c04ac76a90f18e920aaea1026bde90c493c (diff) | |
download | gdb-2b51eddc5503ea84d48c5b3b3ec3388eba440451.zip gdb-2b51eddc5503ea84d48c5b3b3ec3388eba440451.tar.gz gdb-2b51eddc5503ea84d48c5b3b3ec3388eba440451.tar.bz2 |
btrace: Use std::vector in struct btrace_thread_information.
Diffstat (limited to 'gdb/btrace.c')
-rw-r--r-- | gdb/btrace.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gdb/btrace.c b/gdb/btrace.c index 20c977a..46a4d8d 100644 --- a/gdb/btrace.c +++ b/gdb/btrace.c @@ -1857,12 +1857,12 @@ btrace_fetch (struct thread_info *tp) btrace_data_append (&btinfo->data, &btrace); btrace_maint_clear (btinfo); - VEC_truncate (btrace_fun_p, btinfo->functions, 0); + btinfo->functions.clear (); btrace_clear_history (btinfo); btrace_compute_ftrace (tp, &btrace); for (bfun = btinfo->begin; bfun != NULL; bfun = bfun->flow.next) - VEC_safe_push (btrace_fun_p, btinfo->functions, bfun); + btinfo->functions.push_back (bfun); } do_cleanups (cleanup); @@ -1884,8 +1884,7 @@ btrace_clear (struct thread_info *tp) reinit_frame_cache (); btinfo = &tp->btrace; - - VEC_free (btrace_fun_p, btinfo->functions); + btinfo->functions.clear (); it = btinfo->begin; while (it != NULL) @@ -2480,16 +2479,16 @@ btrace_find_insn_by_number (struct btrace_insn_iterator *it, const struct btrace_function *bfun; unsigned int upper, lower; - if (VEC_empty (btrace_fun_p, btinfo->functions)) + if (btinfo->functions.empty ()) return 0; lower = 0; - bfun = VEC_index (btrace_fun_p, btinfo->functions, lower); + bfun = btinfo->functions[lower]; if (number < bfun->insn_offset) return 0; - upper = VEC_length (btrace_fun_p, btinfo->functions) - 1; - bfun = VEC_index (btrace_fun_p, btinfo->functions, upper); + upper = btinfo->functions.size () - 1; + bfun = btinfo->functions[upper]; if (number >= bfun->insn_offset + ftrace_call_num_insn (bfun)) return 0; @@ -2498,7 +2497,7 @@ btrace_find_insn_by_number (struct btrace_insn_iterator *it, { const unsigned int average = lower + (upper - lower) / 2; - bfun = VEC_index (btrace_fun_p, btinfo->functions, average); + bfun = btinfo->functions[average]; if (number < bfun->insn_offset) { |