Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] fix ARM CPSR register fetching in linux
@ 2009-04-21  6:12 Mika Westerberg
  2009-04-21 10:31 ` Joseph S. Myers
  0 siblings, 1 reply; 3+ messages in thread
From: Mika Westerberg @ 2009-04-21  6:12 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

Hi,

Current version of gdb cannot read CPSR register correctly through
ptrace(2) when debugging live process on ARM linux.  Problem is caused
by change where ARM_CPSR_REGNUM (16) was aliased to ARM_PS_REGNUM (25).

This is easy to test on ARM linux targets: just run 'info registers'.

Following patch should fix it.

2009-04-21  Mika Westerberg <mika.westerberg@iki.fi>

        * arm-linux-tdep.h, arm-tdep.h: Changed ARM_CPSR_REGNUM to be
        correct (16) again.

Thanks,
MW

[-- Attachment #2: arm-linux-cpsr.patch --]
[-- Type: text/plain, Size: 1331 bytes --]

Index: gdb/arm-linux-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/arm-linux-tdep.h,v
retrieving revision 1.6
diff -u -r1.6 arm-linux-tdep.h
--- gdb/arm-linux-tdep.h	3 Jan 2009 05:57:50 -0000	1.6
+++ gdb/arm-linux-tdep.h	21 Apr 2009 05:35:35 -0000
@@ -20,6 +20,11 @@
 struct regset;
 struct regcache;
 
+/* This is regnum that is used to fetch cpsr from regset that
+   ptrace(2) gives us.  It is different than ARM_PS_REGNUM which
+   is used to access cpsr from regcache.  */
+#define ARM_CPSR_REGNUM 16
+
 #define ARM_LINUX_SIZEOF_NWFPE (8 * FP_REGISTER_SIZE \
 				+ 2 * INT_REGISTER_SIZE \
 				+ 8 + INT_REGISTER_SIZE)
Index: gdb/arm-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.h,v
retrieving revision 1.33
diff -u -r1.33 arm-tdep.h
--- gdb/arm-tdep.h	3 Jan 2009 05:57:50 -0000	1.33
+++ gdb/arm-tdep.h	21 Apr 2009 05:35:35 -0000
@@ -38,7 +38,6 @@
   ARM_F7_REGNUM = 23, 		/* last floating point register */
   ARM_FPS_REGNUM = 24,		/* floating point status register */
   ARM_PS_REGNUM = 25,		/* Contains processor status */
-  ARM_CPSR_REGNUM = ARM_PS_REGNUM,
   ARM_WR0_REGNUM,		/* WMMX data registers.  */
   ARM_WR15_REGNUM = ARM_WR0_REGNUM + 15,
   ARM_WC0_REGNUM,		/* WMMX control registers.  */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix ARM CPSR register fetching in linux
  2009-04-21  6:12 [PATCH] fix ARM CPSR register fetching in linux Mika Westerberg
@ 2009-04-21 10:31 ` Joseph S. Myers
  2009-04-21 18:06   ` Mika Westerberg
  0 siblings, 1 reply; 3+ messages in thread
From: Joseph S. Myers @ 2009-04-21 10:31 UTC (permalink / raw)
  To: Mika Westerberg; +Cc: gdb-patches

On Tue, 21 Apr 2009, Mika Westerberg wrote:

> Hi,
> 
> Current version of gdb cannot read CPSR register correctly through
> ptrace(2) when debugging live process on ARM linux.  Problem is caused
> by change where ARM_CPSR_REGNUM (16) was aliased to ARM_PS_REGNUM (25).

I believe this is subsumed by Kazu's patch 
<http://sourceware.org/ml/gdb-patches/2009-04/msg00410.html>, which 
appears to be pending review.

-- 
Joseph S. Myers
joseph@codesourcery.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix ARM CPSR register fetching in linux
  2009-04-21 10:31 ` Joseph S. Myers
@ 2009-04-21 18:06   ` Mika Westerberg
  0 siblings, 0 replies; 3+ messages in thread
From: Mika Westerberg @ 2009-04-21 18:06 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gdb-patches

On Tue, Apr 21, 2009 at 10:31:04AM +0000, Joseph S. Myers wrote:
> On Tue, 21 Apr 2009, Mika Westerberg wrote:
> 
> > Hi,
> > 
> > Current version of gdb cannot read CPSR register correctly through
> > ptrace(2) when debugging live process on ARM linux.  Problem is caused
> > by change where ARM_CPSR_REGNUM (16) was aliased to ARM_PS_REGNUM (25).
> 
> I believe this is subsumed by Kazu's patch 
> <http://sourceware.org/ml/gdb-patches/2009-04/msg00410.html>, which 
> appears to be pending review.

Thanks for pointing this out.  I'll then wait for the patch to
be integrated to the upstream.

MW


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-21 18:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-21  6:12 [PATCH] fix ARM CPSR register fetching in linux Mika Westerberg
2009-04-21 10:31 ` Joseph S. Myers
2009-04-21 18:06   ` Mika Westerberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox