From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22936 invoked by alias); 25 Mar 2005 21:48:04 -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 22896 invoked from network); 25 Mar 2005 21:48:00 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 25 Mar 2005 21:48:00 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50 #1 (Debian)) id 1DEwfU-0001Qs-1w; Fri, 25 Mar 2005 16:48:36 -0500 Date: Fri, 25 Mar 2005 21:48:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Cc: Richard Earnshaw Subject: [rfa] Store the CPSR on ARM Linux Message-ID: <20050325214836.GA5450@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com, Richard Earnshaw Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-SW-Source: 2005-03/txt/msg00324.txt.bz2 I noticed when testing Thumb support that calling functions from the opposite execution mode didn't work very well. Nothing ever caused GDB to flush the changed CPSR to the inferior, so we would begin executing ARM functions in Thumb mode or vice versa. Committed to csl-arm-20050325-branch. OK for HEAD? -- Daniel Jacobowitz CodeSourcery, LLC 2005-03-25 Daniel Jacobowitz * arm-linux-nat.c (store_register, store_regs): Handle ARM_PS_REGNUM. Index: gdb/arm-linux-nat.c =================================================================== RCS file: /cvs/src/src/gdb/arm-linux-nat.c,v retrieving revision 1.22 diff -u -p -r1.22 arm-linux-nat.c --- gdb/arm-linux-nat.c 5 Jan 2005 15:43:43 -0000 1.22 +++ gdb/arm-linux-nat.c 25 Mar 2005 21:45:05 -0000 @@ -492,6 +492,12 @@ store_register (int regno) if (regno >= ARM_A1_REGNUM && regno <= ARM_PC_REGNUM) regcache_raw_collect (current_regcache, regno, (char *) ®s[regno]); + else if (arm_apcs_32 && regno == ARM_PS_REGNUM) + regcache_raw_collect (current_regcache, regno, + (char *) ®s[ARM_CPSR_REGNUM]); + else if (!arm_apcs_32 && regno == ARM_PS_REGNUM) + regcache_raw_collect (current_regcache, ARM_PC_REGNUM, + (char *) ®s[ARM_PC_REGNUM]); ret = ptrace (PTRACE_SETREGS, tid, 0, ®s); if (ret < 0) @@ -524,6 +530,10 @@ store_regs (void) regcache_raw_collect (current_regcache, regno, (char *) ®s[regno]); } + if (arm_apcs_32 && register_cached (ARM_PS_REGNUM)) + regcache_raw_collect (current_regcache, ARM_PS_REGNUM, + (char *) ®s[ARM_CPSR_REGNUM]); + ret = ptrace (PTRACE_SETREGS, tid, 0, ®s); if (ret < 0)