This used to hold a function segment pointer. Change it to hold an
index into
the vector of function segments instead.
2017-05-09 Tim Wiederhake <tim.wiederhake@intel.com>
gdb/ChangeLog:
* btrace.c (ftrace_find_call_by_number): New function.
(ftrace_update_caller, ftrace_new_call, ftrace_new_tailcall,
ftrace_get_caller, ftrace_find_call, ftrace_new_return,
ftrace_match_backtrace, ftrace_connect_bfun, ftrace_connect_backtrace,
ftrace_bridge_gap, btrace_bridge_gaps): Use btrace_function::up as an
index.
* btrace.h (struct btrace_function): Turn UP into an index.
* python/py-record-btrace.c (btpy_call_up): Use btrace_function::up
as an index.
* record-btrace.c (record_btrace_frame_unwind_stop_reason,
record_btrace_frame_prev_register, record_btrace_frame_sniffer,
record_btrace_tailcall_frame_sniffe): Same.
@@ -1629,11 +1629,12 @@ record_btrace_frame_prev_register (struct
frame_info *this_frame,
bfun = cache->bfun;
gdb_assert (bfun != NULL);
- caller = bfun->up;
- if (caller == NULL)
+ if (bfun->up == 0)
throw_error (NOT_AVAILABLE_ERROR,
_("No caller in btrace record history"));
+ caller = cache->tp->btrace.functions[bfun->up - 1];
+