aboutsummaryrefslogtreecommitdiff
path: root/gdb/btrace.c
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2013-05-13 14:57:42 +0200
committerMarkus Metzger <markus.t.metzger@intel.com>2014-01-16 12:58:25 +0100
commit5de9129b066591c6ef57829ab9e1c2a030de49af (patch)
tree4c5d36f999ab689d3d5a30be795976e28fccb8b0 /gdb/btrace.c
parent7acbe13307c209309f1733757b6d5d7a2d9bce9b (diff)
downloadgdb-5de9129b066591c6ef57829ab9e1c2a030de49af.zip
gdb-5de9129b066591c6ef57829ab9e1c2a030de49af.tar.gz
gdb-5de9129b066591c6ef57829ab9e1c2a030de49af.tar.bz2
record-btrace: start counting at one
The record instruction-history and record-function-call-history commands start counting instructions at zero. This is somewhat unintuitive when we start navigating in the recorded instruction history. Start at one, instead. 2014-01-16 Markus Metzger <markus.t.metzger@intel.com> * btrace.c (ftrace_new_function): Start counting at one. * record-btrace.c (record_btrace_info): Adjust number of calls and insns. * NEWS: Announce it. testsuite/ * gdb.btrace/instruction_history.exp: Update. * gdb.btrace/function_call_history.exp: Update.
Diffstat (limited to 'gdb/btrace.c')
-rw-r--r--gdb/btrace.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/btrace.c b/gdb/btrace.c
index 5bda127..2e9e008 100644
--- a/gdb/btrace.c
+++ b/gdb/btrace.c
@@ -208,7 +208,13 @@ ftrace_new_function (struct btrace_function *prev,
bfun->lbegin = INT_MAX;
bfun->lend = INT_MIN;
- if (prev != NULL)
+ if (prev == NULL)
+ {
+ /* Start counting at one. */
+ bfun->number = 1;
+ bfun->insn_offset = 1;
+ }
+ else
{
gdb_assert (prev->flow.next == NULL);
prev->flow.next = bfun;