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: [RFA] Have block_innermost_frame start from selected frame


> In such case the doc should be updated, particularly that it has became now
> related to the currently selected frame.

Will do.

> It may be all even more tricky than it was before.  What about using query()
> if such reference is ambiguous?
> 
> It may not be so easy determining the ambiguity.  Something like checking
> symbol_read_needs_frame() and then also checking if there exist >= 2 different
> frames containing the block.

I understand the argument here, but I'm not sure I can agree.  The
ambiguity you speak of already occurs with high frequency, after all,
since when I say
  
    print x

there may be many local x's lying around, both recursive instances of the same
definition or instances of unrelated definitions.  Programmers are
expected to understand this and already have a mechanism for specifying
which they mean (up/frame/down).  It is a very common situation
(especially for someone like me who is always playing around with
compilers in which a significant percentage of calls are recursive).  I
am inclined to think, therefore, that warnings would not be considered helpful.

> And the comment of this function is no longer valid then:
>
> /* Return the innermost stack frame executing inside of BLOCK, or NULL
>    if there is no such frame.  If BLOCK is NULL, just return NULL.  */
>
> struct frame_info *
> block_innermost_frame (const struct block *block)

Good point.  In fact, do you think we should change the function name?
The frame is no longer "innermost", after all.

Paul Hilfinger


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