Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
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 16:12:00 -0000	[thread overview]
Message-ID: <4F29643E.1000907@redhat.com> (raw)
In-Reply-To: <m3pqdybkv6.fsf@fleche.redhat.com>

On 02/01/2012 04:04 PM, Tom Tromey wrote:

> I don't understand why get_selected_frame is the preferred API.  To me
> it seems clearly worse: passing in an error message is ugly, and it
> isn't really possible to distinguish "no frames" from "an exception was
> thrown for some other reason".  Neither of these problems would affect
> get_selected_frame_if_set.
> 
> Perhaps I can do the detection by checking has_stack_frames?  Is that safe?

Yes.  Though you could just call get_selected_block instead (which does the
has_stack_frames check).

       TRY_CATCH (except, RETURN_MASK_ALL)
 	{
-	  selected_frame = get_selected_frame (_("No frame selected."));
-	  block = get_frame_block (selected_frame, NULL);
+	  block = get_selected_block (NULL);
 	}
       GDB_PY_HANDLE_EXCEPTION (except);

-- 
Pedro Alves


  reply	other threads:[~2012-02-01 16:12 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
2012-02-01 16:05   ` Tom Tromey
2012-02-01 16:12     ` Pedro Alves [this message]
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=4F29643E.1000907@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