Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sources.redhat.com
Cc: Richard Earnshaw <Richard.Earnshaw@arm.com>
Subject: [rfa] Store the CPSR on ARM Linux
Date: Fri, 25 Mar 2005 21:48:00 -0000	[thread overview]
Message-ID: <20050325214836.GA5450@nevyn.them.org> (raw)

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  <dan@codesourcery.com>

	* 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 *) &regs[regno]);
+  else if (arm_apcs_32 && regno == ARM_PS_REGNUM)
+    regcache_raw_collect (current_regcache, regno,
+			 (char *) &regs[ARM_CPSR_REGNUM]);
+  else if (!arm_apcs_32 && regno == ARM_PS_REGNUM)
+    regcache_raw_collect (current_regcache, ARM_PC_REGNUM,
+			 (char *) &regs[ARM_PC_REGNUM]);
 
   ret = ptrace (PTRACE_SETREGS, tid, 0, &regs);
   if (ret < 0)
@@ -524,6 +530,10 @@ store_regs (void)
 	regcache_raw_collect (current_regcache, regno, (char *) &regs[regno]);
     }
 
+  if (arm_apcs_32 && register_cached (ARM_PS_REGNUM))
+    regcache_raw_collect (current_regcache, ARM_PS_REGNUM,
+			 (char *) &regs[ARM_CPSR_REGNUM]);
+
   ret = ptrace (PTRACE_SETREGS, tid, 0, &regs);
 
   if (ret < 0)


             reply	other threads:[~2005-03-25 21:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-25 21:48 Daniel Jacobowitz [this message]
2005-03-29 15:49 ` Richard Earnshaw
2005-03-29 16:58   ` 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=20050325214836.GA5450@nevyn.them.org \
    --to=drow@false.org \
    --cc=Richard.Earnshaw@arm.com \
    --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