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


> refrenced doc:
> 	If you wish, you can specify a static variable in a particular
> 	function or file, using the colon-colon (`::') notation:
> 		FILE::VARIABLE
> 		FUNCTION::VARIABLE
> 
> In such case the doc should be updated, particularly that it has became now
> related to the currently selected frame.

Good idea. (and thanks for catching the need to update the
funtion description comment).

> > This change causes block_innermost_frame to start looking from the selected
> > frame, if there is one.
> 
> It may be all even more tricky than it was before.  What about using
> query() if such reference is ambiguous?

What do you mean by ambiguous? Is it the case described here, where
we have multiple frames for the given FUNCTION?

I don't think we should query(). Users often respond negatively
to query, particularly in a case like this where we can make
the behavior unambiguous and easily describable.

I think one reason why I like Paul's choice is the fact that his
suggestion opens the expression to something that is more useful
than the original behavior. With the new behavior, you can get
the old behavior by simply switching back to frame 0, and then
querying FUNCTION::VARIABLE. But the new behavior introduces
the possibility of getting the value of a FUNCTION::VARIABLE inside
another frame by simply selecting that frame. It's the only way
to get the value of "var" in our testcase, and you cannot currently
do it with the old behavior.

> 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 think simple is good enough, in this particular case.

-- 
Joel


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