public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Fix linux-nat.c {,lp->}status typo
Date: Tue, 20 Jul 2010 12:35:00 -0000	[thread overview]
Message-ID: <20100720123504.GA9827@host1.dyn.jankratochvil.net> (raw)
In-Reply-To: <201007201322.28556.pedro@codesourcery.com>

On Tue, 20 Jul 2010 14:22:28 +0200, Pedro Alves wrote:
> On Sunday 18 July 2010 15:51:12, Jan Kratochvil wrote:
> In practice, status == lp->status at this point for !WIFSTOPPED,
> so there should be no impact.

You are right as I see now.  OK, marked ChangeLog entry only as "Code cleanup".


> Okay, thanks.

Checked-in.


Thanks,
Jan


http://sourceware.org/ml/gdb-cvs/2010-07/msg00112.html

--- src/gdb/ChangeLog	2010/07/20 05:58:52	1.12000
+++ src/gdb/ChangeLog	2010/07/20 12:33:29	1.12001
@@ -1,3 +1,9 @@
+2010-07-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Code cleanup.
+	* linux-nat.c (linux_nat_wait_1): Reset STATUS after calling
+	linux_nat_wait_1.  Use always LP->STATUS afterwards.
+
 2010-07-20  Hui Zhu  <teawater@gmail.com>
 
 	* inf-ptrace.c (inf_ptrace_create_inferior): Initialize back_to.
--- src/gdb/linux-nat.c	2010/07/18 21:21:53	1.174
+++ src/gdb/linux-nat.c	2010/07/20 12:33:30	1.175
@@ -3367,6 +3367,9 @@
 
 	  lp = linux_nat_filter_event (lwpid, status, options);
 
+	  /* STATUS is now no longer valid, use LP->STATUS instead.  */
+	  status = 0;
+
 	  if (lp
 	      && ptid_is_pid (ptid)
 	      && ptid_get_pid (lp->ptid) != ptid_get_pid (ptid))
@@ -3375,7 +3378,7 @@
 
 	      if (debug_linux_nat)
 		fprintf (stderr, "LWP %ld got an event %06x, leaving pending.\n",
-			 ptid_get_lwp (lp->ptid), status);
+			 ptid_get_lwp (lp->ptid), lp->status);
 
 	      if (WIFSTOPPED (lp->status))
 		{
@@ -3412,7 +3415,7 @@
 		      lp->signalled = 0;
 		    }
 		}
-	      else if (WIFEXITED (status) || WIFSIGNALED (status))
+	      else if (WIFEXITED (lp->status) || WIFSIGNALED (lp->status))
 		{
 		  if (debug_linux_nat)
 		    fprintf (stderr, "Process %ld exited while stopping LWPs\n",

      reply	other threads:[~2010-07-20 12:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-18 14:51 Jan Kratochvil
2010-07-20 12:22 ` Pedro Alves
2010-07-20 12:35   ` Jan Kratochvil [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=20100720123504.GA9827@host1.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).