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.
This commit is contained in:
Markus Metzger
2013-05-13 14:57:42 +02:00
parent 7acbe13307
commit 5de9129b06
7 changed files with 134 additions and 111 deletions

View File

@@ -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;