From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4488 invoked by alias); 17 Aug 2010 09:00:53 -0000 Received: (qmail 4479 invoked by uid 22791); 17 Aug 2010 09:00:52 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_20,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cam-admin0.cambridge.arm.com (HELO cam-admin0.cambridge.arm.com) (217.140.96.50) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Aug 2010 09:00:45 +0000 Received: from cam-owa2.Emea.Arm.com (cam-owa2.emea.arm.com [10.1.105.18]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id o7H8wWF9026309; Tue, 17 Aug 2010 09:58:33 +0100 (BST) Received: from [10.1.77.63] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 17 Aug 2010 09:59:28 +0100 Subject: Re: [patch] Add support for ARMv7M devices. From: Matthew Gretton-Dann To: Daniel Jacobowitz Cc: Richard Earnshaw , Kazu Hirata , gdb-patches@sourceware.org, Jonathan Larmour In-Reply-To: <20100816180525.GA13106@caradoc.them.org> References: <20100609140312.291855664EF@henry1.codesourcery.com> <4C101E0B.4040006@buzzard.freeserve.co.uk> <20100624164149.GD8410@caradoc.them.org> <4C23BA28.80106@buzzard.freeserve.co.uk> <20100816180525.GA13106@caradoc.them.org> Content-Type: text/plain; charset="ISO-8859-1" Date: Tue, 17 Aug 2010 09:00:00 -0000 Message-ID: <1282035567.4798.39.camel@e102319-lin.cambridge.arm.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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-08/txt/msg00256.txt.bz2 Daniel, In arm_gdbarch_init you have the following: On Mon, 2010-08-16 at 14:05 -0400, Daniel Jacobowitz wrote: > +#ifdef HAVE_ELF > + /* Detect M-profile programs. */ > + attr = bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_PROC, > + Tag_CPU_arch); > + /* The lowest value with a meaningful profile is V7; V6-M > + has a higher attribute value. */ > + if (attr >= TAG_CPU_ARCH_V7) > + { > + attr = bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_PROC, > + Tag_CPU_arch_profile); > + if (attr == 'M' && ! tdesc_has_registers (tdesc)) > + tdesc = tdesc_arm_with_m; > + } > +#endif Some toolchains do not output Tag_CPU_arch_profile for v6-M or v6S-M (I think they are taking the viewthat v6-M is before v7 and so Tag_CPU_arch_profile does not apply). So this part of the patch will not pick up images built for v6-M or v6S-M by those toolchains. You probably need an explicit test for Tag_CPU_arch being TAG_CPU_ARCH_V6_M or TAG_CPU_ARCH_V6S_M and if it is then forcing M-profile at the point (as well as the full test for architecture v7 and above). Otherwise it looks good to me. Thanks, Matt -- Matthew Gretton-Dann Principal Engineer - PDSW Tools ARM Ltd