Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Phil Muldoon <pmuldoon@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch][python] PR python/16324 (frame_id_eq check invalid)
Date: Wed, 26 Feb 2014 11:12:00 -0000	[thread overview]
Message-ID: <530DCC16.7030406@redhat.com> (raw)
In-Reply-To: <530DAA99.6090209@redhat.com>

On 02/26/2014 08:49 AM, Phil Muldoon wrote:

> +
> +          /* If prev_frame != NULL, and get_frame_id cannot return
> +         the frame_id, there is nothing more to be done.  At
> +         this point, assert that a valid frame id is
> +         returned.  */

A nit (sorry!) - I find this "there is nothing more to be
done" in the comment a little bit confusing/distracting.  That
reads to me like a comment we'd write when doing a regular
early return, because whatever the function was supposed to
had already been done.

You had a good rationale in the intro.  I'd suggest basing on it,
saying this instead:

          /* All frames other than the sentinel (which PREV_FRAME can't
	     be, as we are traversing the opposite direction)
	     must have a valid id.  If we get back a null_frame_id with
	     prev_frame != NULL, something is messed up.  */

> +          gdb_assert (frame_id_p (frame_id) != 0);

Please write:

          gdb_assert (frame_id_p (frame_id));

The '_p' suffix stands for predicate, indicating the function
returns a boolean, and for those, we use 'if (foo())' / 'if (!foo())'.

OK with that change.

Thanks,
-- 
Pedro Alves


      reply	other threads:[~2014-02-26 11:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26  8:49 Phil Muldoon
2014-02-26 11:12 ` Pedro Alves [this message]

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=530DCC16.7030406@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pmuldoon@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