This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3 08/12] btrace: Replace struct btrace_thread_info::up.


On 2017-05-09 02:55, Tim Wiederhake wrote:
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.

LGTM, just a question below.

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

Would it be good to export ftrace_find_call_by_number so it can be used at a few places in this file?

Thanks,

Simon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]