From: Andrew Cagney <ac131313@redhat.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFC: selected frame in read_var_value
Date: Fri, 05 Sep 2003 17:14:00 -0000 [thread overview]
Message-ID: <3F58C35A.3060908@redhat.com> (raw)
In-Reply-To: <20030828195501.GB27550@nevyn.them.org>
> 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?
Yep, welcome to my world :-)
> 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.
What about something like this as a step sideways:
> if (frame == NULL)
> frame = deprecated_safe_get_selected_frame ();
where deprecated_safe_get_selected_frame() would contain those sanity
checks?
Andrew
next prev parent reply other threads:[~2003-09-05 17:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-01 19:29 Daniel Jacobowitz
2003-08-07 17:45 ` Andrew Cagney
2003-08-28 19:55 ` Daniel Jacobowitz
2003-09-05 17:14 ` Andrew Cagney [this message]
2003-09-05 17:18 ` Daniel Jacobowitz
2003-09-05 17:39 ` Andrew Cagney
2003-09-07 3:53 ` Daniel Jacobowitz
2003-09-08 13:33 ` Andrew Cagney
2003-09-08 13:37 ` Daniel Jacobowitz
2003-09-08 18:59 ` Daniel Jacobowitz
2004-02-08 4:17 ` Daniel Jacobowitz
2004-02-08 17:33 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F58C35A.3060908@redhat.com \
--to=ac131313@redhat.com \
--cc=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox