forked from Imagelibrary/binutils-gdb
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user