This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH v3 08/12] btrace: Replace struct btrace_thread_info::up.
Hi Simon,
Thanks for reviewing!
> -----Original Message-----
> From: Simon Marchi [mailto:simon.marchi@polymtl.ca]
> Sent: Wednesday, May 10, 2017 5:27 AM
> To: Wiederhake, Tim <tim.wiederhake@intel.com>
> Cc: gdb-patches@sourceware.org; Metzger, Markus T
> <markus.t.metzger@intel.com>
> Subject: 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?
We should tackle this in a future patch set.
> Thanks,
>
> Simon
Regards,
Tim
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928