aboutsummaryrefslogtreecommitdiff
path: root/gdb/btrace.c
diff options
context:
space:
mode:
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;