Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sources.redhat.com
Subject: [ob] Don't clobber inferior_ptid in read_pc_pid
Date: Sat, 28 Feb 2004 17:35:00 -0000	[thread overview]
Message-ID: <20040228173541.GA15776@nevyn.them.org> (raw)

Another issue found in testing on arm-linux.  A return was added to this
function back in June; if we return from the middle of it, we leave
inferior_ptid set to the wrong thread.  This causes a "!ptid_equal
(ecs->ptid, inferior_ptid)" test to fail, since we called read_pc_pid
with ecs->ptid.  That leads to not calling context_switch; which clobbers
the stepping range for the previous thread; which causes stepping to stop
unexpectedly.

I'll commit this patch as obvious in a day or two.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2004-02-28  Daniel Jacobowitz  <drow@mvista.com>

	* regcache.c (read_pc_pid): Restore inferior_ptid after reading
	PC_REGNUM.

Index: gdb/regcache.c
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/regcache.c,v
retrieving revision 1.108
diff -u -p -r1.108 regcache.c
--- gdb/regcache.c	15 Feb 2004 15:22:06 -0000	1.108
+++ gdb/regcache.c	27 Feb 2004 19:31:13 -0000
@@ -1332,8 +1332,7 @@ read_pc_pid (ptid_t ptid)
   else if (PC_REGNUM >= 0)
     {
       CORE_ADDR raw_val = read_register_pid (PC_REGNUM, ptid);
-      CORE_ADDR pc_val = ADDR_BITS_REMOVE (raw_val);
-      return pc_val;
+      pc_val = ADDR_BITS_REMOVE (raw_val);
     }
   else
     internal_error (__FILE__, __LINE__, "read_pc_pid: Unable to find PC");


             reply	other threads:[~2004-02-28 17:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-28 17:35 Daniel Jacobowitz [this message]
2004-02-28 19:32 ` Andrew Cagney
2004-02-29  3:14   ` Daniel Jacobowitz
2004-02-29  4:02     ` Andrew Cagney
2004-02-29 17:02 ` Daniel Jacobowitz

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=20040228173541.GA15776@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sources.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