This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Add support for ARMv7M devices.
- From: Matthew Gretton-Dann <matthew dot gretton-dann at arm dot com>
- To: Daniel Jacobowitz <dan at codesourcery dot com>
- Cc: Richard Earnshaw <Richard dot Earnshaw at buzzard dot freeserve dot co dot uk>, Kazu Hirata <kazu at codesourcery dot com>, gdb-patches at sourceware dot org, Jonathan Larmour <jifl at eCosCentric dot com>
- Date: Tue, 17 Aug 2010 09:59:27 +0100
- Subject: Re: [patch] Add support for ARMv7M devices.
- 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>
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