diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2013-03-26 11:32:20 +0100 |
---|---|---|
committer | Markus Metzger <markus.t.metzger@intel.com> | 2014-01-16 12:45:12 +0100 |
commit | 7acbe13307c209309f1733757b6d5d7a2d9bce9b (patch) | |
tree | 6aac3a9b6111051c8d52fc8e2424efd7db4379d0 | |
parent | 23a7fe7580c5625dd19c852faf9a3acb56293207 (diff) | |
download | gdb-7acbe13307c209309f1733757b6d5d7a2d9bce9b.zip gdb-7acbe13307c209309f1733757b6d5d7a2d9bce9b.tar.gz gdb-7acbe13307c209309f1733757b6d5d7a2d9bce9b.tar.bz2 |
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 <markus.t.metzger@intel.com>
* record-btrace.c (btrace_call_history_insn_range): Print
insn range as [begin, end].
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | 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 <markus.t.metzger@intel.com> + * record-btrace.c (btrace_call_history_insn_range): Print + insn range as [begin, end]. + +2014-01-16 Markus Metzger <markus.t.metzger@intel.com> + * 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, "-"); |