This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Use of create_new_frame from 'frame'.
- From: Pedro Alves <palves at redhat dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>, gdb-patches at sourceware dot org
- Date: Wed, 08 Jul 2015 19:02:02 +0100
- Subject: Re: [RFC] Use of create_new_frame from 'frame'.
- Authentication-results: sourceware.org; auth=none
- References: <20150708170944 dot GA17985 at embecosm dot com>
On 07/08/2015 06:09 PM, Andrew Burgess wrote:
> The 'frame' command can cause 'create_new_frame' in some conditions:
>
> - When two arguments are passed, or
> - When one argument is passed that is not:
> - A valid index into the backtrace, or
> - A valid stack frame base address.
>
> Personally, I dislike this behaviour because:
>
> 1. It's easy to make a mistake using the frame command and create a
> new frame. It's not obvious (I think) how to recover from this
> situation. [ The answer is just to use 'frame' again with a
> valid frame specifier argument. ]
>
> 2. As a backtrace can be possibly any depth then depending on where
> we stop alters which frames we can create. This seems a little
> arbitrary.
>
Totally agreed. See here for my previous suggestions:
https://sourceware.org/ml/gdb/2014-11/msg00028.html
Related bugs:
https://sourceware.org/bugzilla/show_bug.cgi?id=18074
https://sourceware.org/bugzilla/show_bug.cgi?id=8864
> We could improve #1 by not allowing small indexes that are close to
> the number of frames in the backtrace, however, this feels like a bit
> of a hack, and would be a little annoying on small targets where low
> value addresses are actually valid.
Yeah, yuck. :-)
Thanks,
Pedro Alves