From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 342 invoked by alias); 28 Feb 2004 17:35:42 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 334 invoked from network); 28 Feb 2004 17:35:42 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 28 Feb 2004 17:35:42 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1Ax8NJ-000470-O0 for ; Sat, 28 Feb 2004 12:35:41 -0500 Date: Sat, 28 Feb 2004 17:35:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: [ob] Don't clobber inferior_ptid in read_pc_pid Message-ID: <20040228173541.GA15776@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.1i X-SW-Source: 2004-02/txt/msg00831.txt.bz2 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 * 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");