From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20234 invoked by alias); 9 Mar 2012 16:29:18 -0000 Received: (qmail 20211 invoked by uid 22791); 9 Mar 2012 16:29:14 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Mar 2012 16:28:54 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q29GSmF2006190 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 9 Mar 2012 11:28:49 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q29GSkxs004782; Fri, 9 Mar 2012 11:28:47 -0500 Message-ID: <4F5A2FBE.2070201@redhat.com> Date: Fri, 09 Mar 2012 16:29:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 MIME-Version: 1.0 To: Jonathan Larmour CC: Yao Qi , gdb-patches@sourceware.org Subject: Re: Fwd: Re: [patch] Add support for ARMv7M devices. References: <4F598611.4020506@eCosCentric.com> <4F5A240C.1010702@codesourcery.com> <4F5A2C12.6000300@eCosCentric.com> In-Reply-To: <4F5A2C12.6000300@eCosCentric.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/msg00337.txt.bz2 On 03/09/2012 04:13 PM, Jonathan Larmour wrote: > 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. I think that's always true, irrespective of a g packet guess being installed. See target_find_description: it's always "file > target xml > g-guesses", > 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); so if we unconditionally register the guesses, then even "set tdesc foo; file foo; unset tdesc filename; tar rem ..." works correctly. -- Pedro Alves