[RFC] Use of create_new_frame from 'frame'.

Pedro Alves palves@redhat.com
Wed Jul 8 18:02:00 GMT 2015


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



More information about the Gdb-patches mailing list