From: Pedro Alves <palves@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFA: fix PR python/13351
Date: Wed, 01 Feb 2012 10:41:00 -0000 [thread overview]
Message-ID: <4F2916BE.6020105@redhat.com> (raw)
In-Reply-To: <m339avednx.fsf@fleche.redhat.com>
On 01/31/2012 09:59 PM, Tom Tromey wrote:
> --- a/gdb/python/py-symbol.c
> +++ b/gdb/python/py-symbol.c
> @@ -292,8 +292,9 @@ gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
>
> TRY_CATCH (except, RETURN_MASK_ALL)
> {
> - selected_frame = get_selected_frame (_("No frame selected."));
> - block = get_frame_block (selected_frame, NULL);
> + selected_frame = get_selected_frame_if_set ();
> + if (selected_frame)
> + block = get_frame_block (selected_frame, NULL);
> }
I'm getting a bit nervous about get_selected_frame_if_set usages getting spread
around. (It feels a bit like we're going back in time, to a time before the
always-a-frame work.) The selected frame may not be set, while we still may have
a current frame, so get_selected_frame would lazily select it, and so the lookup
would still start on a frame block. If you don't want an error, you can pass NULL
to get_selected_frame.
--
Pedro Alves
next prev parent reply other threads:[~2012-02-01 10:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-31 22:02 Tom Tromey
2012-01-31 23:23 ` Doug Evans
2012-02-01 11:52 ` Phil Muldoon
2012-02-01 16:03 ` Tom Tromey
2012-02-01 16:02 ` Tom Tromey
2012-02-01 19:21 ` Doug Evans
2012-02-01 10:41 ` Pedro Alves [this message]
2012-02-01 16:05 ` Tom Tromey
2012-02-01 16:12 ` Pedro Alves
2012-02-01 16:17 ` Tom Tromey
2012-02-07 18:05 ` Tom Tromey
2012-02-07 18:49 ` Eli Zaretskii
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=4F2916BE.6020105@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@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