From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6331 invoked by alias); 9 Mar 2012 16:13:24 -0000 Received: (qmail 6321 invoked by uid 22791); 9 Mar 2012 16:13:22 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from hagrid.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Mar 2012 16:13:09 +0000 Received: from localhost (hagrid.ecoscentric.com [127.0.0.1]) by mail.ecoscentric.com (Postfix) with ESMTP id D1DC12F78003; Fri, 9 Mar 2012 16:13:08 +0000 (GMT) Received: from mail.ecoscentric.com ([127.0.0.1]) by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mX8pKmaMSzYa; Fri, 9 Mar 2012 16:13:07 +0000 (GMT) Message-ID: <4F5A2C12.6000300@eCosCentric.com> Date: Fri, 09 Mar 2012 16:13:00 -0000 From: Jonathan Larmour User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.16 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: Fwd: Re: [patch] Add support for ARMv7M devices. References: <4F598611.4020506@eCosCentric.com> <4F5A240C.1010702@codesourcery.com> In-Reply-To: <4F5A240C.1010702@codesourcery.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: 2012-03/txt/msg00336.txt.bz2 On 09/03/12 15:38, Yao Qi wrote: > On 03/09/2012 12:24 PM, Jonathan Larmour wrote: >> - tdesc = tdesc_arm_with_m; >> + is_m = 1; > > `tdesc' is used later in the function, > > /* Check any target description for validity. */ > if (tdesc_has_registers (tdesc)) > > Is it correct to skip updating `tdesc'? Yes we do not want that condition to match. We want the tdesc to still be undetermined by the point of the 'if' test if this is Cortex-M. The code prior to this change only set tdesc because it thought it knew exactly what register set to use by that point. But you have made me think of one improvement: we should probably not call register_remote_g_packet_guess() if tdesc_has_registers (tdesc) - because if someone has directly supplied a target description, we should solely use that, and avoid any guessing. This would be true for both my and Pedro's patch. That's trivial to handle though, e.g. for Pedro's patch, just replace the call with: if (!tdesc_has_registers (tdesc)) arm_register_g_packet_guesses (gdbarch); Jifl -- eCosCentric Limited http://www.eCosCentric.com/ The eCos experts Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571 Registered in England and Wales: Reg No 4422071. ------["Si fractum non sit, noli id reficere"]------ Opinions==mine