From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2230 invoked by alias); 4 Mar 2010 17:38:05 -0000 Received: (qmail 2218 invoked by uid 22791); 4 Mar 2010 17:38:04 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Mar 2010 17:37:59 +0000 Received: from kpbe18.cbf.corp.google.com (kpbe18.cbf.corp.google.com [172.25.105.82]) by smtp-out.google.com with ESMTP id o24HbuZx022850 for ; Thu, 4 Mar 2010 17:37:57 GMT Received: from ey-out-2122.google.com (eya25.prod.google.com [10.208.1.25]) by kpbe18.cbf.corp.google.com with ESMTP id o24Hbran019166 for ; Thu, 4 Mar 2010 09:37:55 -0800 Received: by ey-out-2122.google.com with SMTP id 25so772856eya.5 for ; Thu, 04 Mar 2010 09:37:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.90.7 with SMTP id d7mr6280647wef.81.1267724272654; Thu, 04 Mar 2010 09:37:52 -0800 (PST) In-Reply-To: <20100304133944.GA21490@caradoc.them.org> References: <1267703327.13980.13.camel@e102111-lin.cambridge.arm.com> <20100304133944.GA21490@caradoc.them.org> Date: Thu, 04 Mar 2010 17:38:00 -0000 Message-ID: Subject: Re: [PATCH] [ARM] Improve heuristic to guess the instruction state for the next PC when single-stepping From: Doug Evans To: Matthew Gretton-Dann , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes 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: 2010-03/txt/msg00195.txt.bz2 On Thu, Mar 4, 2010 at 5:39 AM, Daniel Jacobowitz wr= ote: > On Thu, Mar 04, 2010 at 11:48:47AM +0000, Matthew Gretton-Dann wrote: >> This patch attempts to fix this by seeing if arm_pc_is_thumb () is being >> asked about the address we will end up at if we execute the instruction >> at the current PC. =A0If so it 'executes' the current instruction to see >> if it will change state, and uses this information to determine the >> return value. > > This is a cute approach. =A0I can't think of any potential problems with > it, so I'll commit your patch. > >> 2010-03-04 =A0Matthew Gretton-Dann =A0 >> >> =A0 =A0 =A0 * arm-tdep.c (arm_pc_is_thumb): Add heuristic that tries to = get >> =A0 =A0 =A0 the state right when single stepping. >> =A0 =A0 =A0 (arm_get_next_pc_raw, thumb_get_next_pc_raw): New functions. >> =A0 =A0 =A0 Get the next PC along with the instruction state. >> =A0 =A0 =A0 (thumb_get_next_pc): Remove. >> =A0 =A0 =A0 (arm_get_next_pc): Modified to use arm_get_next_pc_raw (). > > At some point we were asked to not use " ()" to indicate functions, so > I've removed that bit. Would it be nice to prefer what the hardware says over what the symbol info says? [And if the symbol info disagrees flag a warning?] [The heuristic is done after symbol checks.]