From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9807 invoked by alias); 21 Apr 2009 06:12:20 -0000 Received: (qmail 9797 invoked by uid 22791); 21 Apr 2009 06:12:19 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-fx0-f167.google.com (HELO mail-fx0-f167.google.com) (209.85.220.167) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Apr 2009 06:12:12 +0000 Received: by fxm11 with SMTP id 11so2486771fxm.24 for ; Mon, 20 Apr 2009 23:12:09 -0700 (PDT) Received: by 10.204.71.68 with SMTP id g4mr6125819bkj.135.1240294329308; Mon, 20 Apr 2009 23:12:09 -0700 (PDT) Received: from blade.healthdatacare.com (a88-112-76-182.elisa-laajakaista.fi [88.112.76.182]) by mx.google.com with ESMTPS id 12sm11707084fks.25.2009.04.20.23.12.08 (version=SSLv3 cipher=RC4-MD5); Mon, 20 Apr 2009 23:12:09 -0700 (PDT) Date: Tue, 21 Apr 2009 06:12:00 -0000 From: Mika Westerberg To: gdb-patches@sourceware.org Subject: [PATCH] fix ARM CPSR register fetching in linux Message-ID: <20090421060715.GC12530@blade.healthdatacare.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="wxDdMuZNg1r63Hyj" Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00553.txt.bz2 --wxDdMuZNg1r63Hyj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 483 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 * arm-linux-tdep.h, arm-tdep.h: Changed ARM_CPSR_REGNUM to be correct (16) again. Thanks, MW --wxDdMuZNg1r63Hyj Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="arm-linux-cpsr.patch" Content-length: 1331 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. */ --wxDdMuZNg1r63Hyj--