This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Add support for ARMv7M devices.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]