From 7acbe13307c209309f1733757b6d5d7a2d9bce9b Mon Sep 17 00:00:00 2001 From: Markus Metzger Date: Tue, 26 Mar 2013 11:32:20 +0100 Subject: [PATCH] record-btrace: fix insn range in function call history With the "/i" modifier, we print the instruction number range in the "record function-call-history" command as [begin, end). It would be more intuitive if we printed the range as [begin, end]. 2014-01-16 Markus Metzger * record-btrace.c (btrace_call_history_insn_range): Print insn range as [begin, end]. --- gdb/ChangeLog | 5 +++++ gdb/record-btrace.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c84ae2d..421c62a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2014-01-16 Markus Metzger + * record-btrace.c (btrace_call_history_insn_range): Print + insn range as [begin, end]. + +2014-01-16 Markus Metzger + * btrace.h (struct btrace_func_link): New. (enum btrace_function_flag): New. (struct btrace_inst): Rename to ... diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c index 5bdab8d..95d7069 100644 --- a/gdb/record-btrace.c +++ b/gdb/record-btrace.c @@ -424,10 +424,13 @@ static void btrace_call_history_insn_range (struct ui_out *uiout, const struct btrace_function *bfun) { - unsigned int begin, end; + unsigned int begin, end, size; + + size = VEC_length (btrace_insn_s, bfun->insn); + gdb_assert (size > 0); begin = bfun->insn_offset; - end = begin + VEC_length (btrace_insn_s, bfun->insn); + end = begin + size - 1; ui_out_field_uint (uiout, "insn begin", begin); ui_out_text (uiout, "-"); -- 2.7.4