Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 3/3] Convert default_child_has_foo functions to process_stratum_target methods
Date: Thu, 29 Nov 2018 18:31:00 -0000	[thread overview]
Message-ID: <877egvburv.fsf@tromey.com> (raw)
In-Reply-To: <20181127202247.7646-4-palves@redhat.com> (Pedro Alves's message	of "Tue, 27 Nov 2018 20:22:47 +0000")

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> +bool
Pedro> +process_stratum_target::has_all_memory ()
Pedro> +{
Pedro> +  /* If no inferior selected, then we can't read memory here.  */
Pedro> +  if (inferior_ptid == null_ptid)
Pedro> +    return false;
Pedro> +
Pedro> +  return true;

I don't really care too much but I was wondering why not just

  return inferior_ptid != null_ptid;

Pedro> +bool
Pedro> +process_stratum_target::has_execution (ptid_t the_ptid)
Pedro> +{
Pedro> +  /* If there's no thread selected, then we can't make it run through
Pedro> +     hoops.  */
Pedro> +  if (the_ptid == null_ptid)
Pedro> +    return 0;
Pedro> +
Pedro> +  return 1;

This one should use true/false.

Tom


  reply	other threads:[~2018-11-29 18:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27 20:22 [PATCH 0/3] Introduce process_stratum_target Pedro Alves
2018-11-27 20:22 ` [PATCH 1/3] Move test_target_ops to a separate file Pedro Alves
2018-11-27 20:23 ` [PATCH 3/3] Convert default_child_has_foo functions to process_stratum_target methods Pedro Alves
2018-11-29 18:31   ` Tom Tromey [this message]
2018-11-30 16:31     ` Pedro Alves
2018-11-27 20:23 ` [PATCH 2/3] Introduce process_stratum_target Pedro Alves
2018-11-29 18:26   ` Tom Tromey
2018-11-29 23:16     ` Tom Tromey
2018-11-30 14:22     ` Pedro Alves
2018-11-30 15:40       ` Tom Tromey
2018-11-30 17:52         ` Pedro Alves
2018-11-29 18:31 ` [PATCH 0/3] " Tom Tromey

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=877egvburv.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@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