This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH v2 2/3] frame: use get_prev_frame_always in skip_tailcall_frames
- From: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: Pedro Alves <palves at redhat dot com>, Joel Brobecker <brobecker at adacore dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 15 Feb 2016 09:50:57 +0000
- Subject: RE: [PATCH v2 2/3] frame: use get_prev_frame_always in skip_tailcall_frames
- Authentication-results: sourceware.org; auth=none
- References: <1454681922-2228-1-git-send-email-markus dot t dot metzger at intel dot com> <1454681922-2228-2-git-send-email-markus dot t dot metzger at intel dot com> <20160207130057 dot GE20874 at adacore dot com> <A78C989F6D9628469189715575E55B233325F370 at IRSMSX104 dot ger dot corp dot intel dot com> <56B9D08F dot 6060507 at redhat dot com> <20160209115819 dot GH15342 at adacore dot com> <A78C989F6D9628469189715575E55B233325FBEB at IRSMSX104 dot ger dot corp dot intel dot com> <56B9FA90 dot 5030602 at redhat dot com> <A78C989F6D9628469189715575E55B233325FCA0 at IRSMSX104 dot ger dot corp dot intel dot com>
> -----Original Message-----
> From: Metzger, Markus T
> Sent: Tuesday, February 9, 2016 4:20 PM
> To: Pedro Alves <palves@redhat.com>; Joel Brobecker
> <brobecker@adacore.com>
> Cc: gdb-patches@sourceware.org
> Subject: RE: [PATCH v2 2/3] frame: use get_prev_frame_always in
> skip_tailcall_frames
> > > I'm beginning to wonder if not all-but-the-backtrace-command-related
> > > get_prev_frame calls should really be calling get_prev_frame_always.
> > >
> > > The _always extension isn't very intuitive, though, given that this
> > > should be the standard function to use. Should get_prev_frame maybe
> > > be renamed to something like get_prev_frame_within_limit and
> > > get_prev_frame_always to get_prev_frame?
> >
> > Maybe a good idea. See also:
> >
> > https://sourceware.org/bugzilla/show_bug.cgi?id=15558
> >
> > I just noticed/remembered something -- the check for backtracing past
> > main and the entry point is in get_prev_frame, get_prev_frame_always
> > bypasses it.
> >
> > This means that with your change, I think gdb now allows "finish" in
> > "main" or in "_start".
> >
> > Maybe not a bad change, but I though it'd call it out explicitly.
>
> There are 46 calls to get_prev_frame ignoring this patch. Each of them
> should maybe be modified to call get_prev_frame_always, instead. And
> none of this is currently covered by the test suite.
I'm wondering in which cases GDB should ignore the user-defined backtrace
limit. And if GDB should ignore it at all.
If the limit is set, some aspects of GDB may not function any longer. But that's
to be expected, isn't it?
GDB shouldn't crash, of course. But I'm not sure if it should ignore user settings
in too many cases. Maybe we should even switch back to get_prev_frame in
skip_artificial_frames and rely on handling the NULL return if we exceed the
backtrace limit?
Regards,
Markus.
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