RFC: selected frame in read_var_value
Daniel Jacobowitz
drow@mvista.com
Thu Aug 28 19:55:00 GMT 2003
On Thu, Aug 07, 2003 at 01:45:28PM -0400, Andrew Cagney wrote:
> >Thoughts on this? I observed one case where the selected frame hadn't been
> >initialized yet: when checking watchpoint values. Oops! The condition
> >matches the case in which get_current_frame () can be reasonably expected
> >to
> >succeed. There are a couple other places that need this same check, mostly
> >functions which will work on globals as well as locals.
>
> I think the caller, and not this code, should be the one deciding
> if/when a get_selected_frame should be called. Otherwize the dependance
> on global state remains.
The callers don't know any more than we do. Take a look at some of
them - several callers don't take frame arguments, and work both when
the program is running and when it isn't. If you want to cut down on
the global state dependence, I guess you'd have to push this up through
every caller, so that it could eventually be pushed even higher?
Me, I was just fixing the regression caused by lazily selecting a
frame. I wasn't planning on redesigning interfaces all through the
block and variable layers; and fixing this really does go quite far up.
For instance it works back to block_innermost_frame, which can return
NULL.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
More information about the Gdb-patches
mailing list