Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>,
	GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2] Use "switch_to_thread" more thoroughly on gdbserver
Date: Tue, 26 Sep 2017 12:28:00 -0000	[thread overview]
Message-ID: <ad4dd6c5-ce85-d216-3fcb-23b0e7b80576@redhat.com> (raw)
In-Reply-To: <20170926042239.30748-1-sergiodj@redhat.com>

On 09/26/2017 05:22 AM, Sergio Durigan Junior wrote:

> gdb/gdbserver/ChangeLog:
> yyyy-mm-dd  Sergio Durigan Junior  <sergiodj@redhat.com>
> 
> 	* gdbthread.h: Include "common-gdbthread.h".
> 	* inferiors.c (switch_to_thread): Use "gdb_assert" instead of
> 	"if" when validating the ptid.
> 	* remote-utils.c: Include "gdbthread.h".
> 	(prepare_resume_reply): Use "switch_to_thread".
> 	* target.c (done_accessing_memory): Likewise.

OK

>  void
>  switch_to_thread (ptid_t ptid)
>  {
> -  if (!ptid_equal (ptid, minus_one_ptid))
> -    current_thread = find_thread_ptid (ptid);
> +  gdb_assert (!ptid_equal (ptid, minus_one_ptid));

Note you can write:

  gdb_assert (ptid != minus_one_ptid);

nowadays.

Thanks,
Pedro Alves


  reply	other threads:[~2017-09-26 12:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-15  4:34 [PATCH] " Sergio Durigan Junior
2017-09-15 11:14 ` Pedro Alves
2017-09-15 18:25   ` Sergio Durigan Junior
2017-09-21 15:11     ` Pedro Alves
2017-09-21 15:42       ` Sergio Durigan Junior
2017-09-26  4:23 ` [PATCH v2] " Sergio Durigan Junior
2017-09-26 12:28   ` Pedro Alves [this message]
2017-09-26 16:52     ` Sergio Durigan Junior

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=ad4dd6c5-ce85-d216-3fcb-23b0e7b80576@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@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