]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix v850 bfd arch info printable names
authorPedro Alves <palves@redhat.com>
Wed, 9 Mar 2016 15:43:13 +0000 (15:43 +0000)
committerPedro Alves <palves@redhat.com>
Wed, 9 Mar 2016 15:43:13 +0000 (15:43 +0000)
Currently, it's not possible to manually set some of the v850 archs in
gdb:

 (gdb) set architecture v850<TAB>
 v850 (using old gcc ABI)
 v850-rh850
 v850e
 v850e (using old gcc ABI)
 v850e1
 [...]
 (gdb) set architecture v850 (using old gcc ABI)
 Ambiguous item "v850 (using old gcc ABI)".

The problem is that "set architecture" is a GDB "enum command", and
GDB only considers an enum value to be the string up until the first
space.  So writing "v850 (using old gcc ABI)" is the same as writing
"v850", and then that's not an unambiguous arch printable name prefix.

v850 is actually the only arch that has spaces in its printable name.
One can conveniently see that with e.g.:

 (gdb) set max-completions unlimited
 (gdb) complete set architecture
 ...

Rather than hack GDB into accepting this somehow, make v850 arch
printable names more like the printable names of the other archs, and
put the abi variant in the "machine" part, after a ':'.

We now get:

 (gdb) set architecture v850<TAB>
 v850:old-gcc-abi
 v850:rh850
 v850e
 v850e1
 v850e1:old-gcc-abi
 v850e2
 v850e2:old-gcc-abi
 [...]

And now "set architecture v850:old-gcc-abi" works as expected.

I ran the binutils/gas/ld testsuites, and found no regressions.  I
don't have a cross compiler handy, but I ran the gdb tests anyway,
which covers at least some snoke testing.

I think that the OUTPUT_ARCH in ld/scripttempl/v850.sc may have got
broken with the previous 2012 change, since I hacked v850_rh850.sc to
output "v850" and ld failed to grok it.  I think it only works if the
old GCC ABI is the configured v850 default ABI.  That's now fixed by
changing to use explicit v850:old-gcc-abi.

Also, this actually "fixes" an existing GDB test, which isn't likewise
expecting spaces in arch names, when GDB is configured for
--target=v850:

  (gdb) FAIL: gdb.xml/tdesc-arch.exp: read valid architectures

bfd/ChangeLog:
2016-03-09  Pedro Alves  <palves@redhat.com>

* cpu-v850.c (N): Append ":old-gcc-abi" instead of " (using old
gcc ABI)" to printable name.
* cpu-v850_rh850.c (bfd_v850_rh850_arch): Use "v850:rh850" instead
of "v850-rh850" as printable name.

ld/ChangeLog:
2016-03-09  Pedro Alves  <palves@redhat.com>

* scripttempl/v850.sc: Use "v850:old-gcc-abi" as OUTPUT_ARCH.
* scripttempl/v850_rh850.sc: Use "v850:rh850" as OUTPUT_ARCH.

bfd/ChangeLog
bfd/cpu-v850.c
bfd/cpu-v850_rh850.c
ld/ChangeLog
ld/scripttempl/v850.sc
ld/scripttempl/v850_rh850.sc

index d0dfd9bf4415114a9db71faae799deda1324a9f4..b2075e4b30d02c610641bc6e0f5a35cc4142cefc 100644 (file)
@@ -1,3 +1,10 @@
+2016-03-09  Pedro Alves  <palves@redhat.com>
+
+       * cpu-v850.c (N): Append ":old-gcc-abi" instead of " (using old
+       gcc ABI)" to printable name.
+       * cpu-v850_rh850.c (bfd_v850_rh850_arch): Use "v850:rh850" instead
+       of "v850-rh850" as printable name.
+
 2016-03-09  Leon Winter  <winter-gcc@bfw-online.de>
 
        PR ld/19623
index 472c578156b20b76d9859967feca72ad41933648..d82d4c02eb340e37b95084fd8534af634e838df5 100644 (file)
@@ -24,7 +24,7 @@
 #include "safe-ctype.h"
 
 #define N(number, print, default, next)  \
-{  32, 32, 8, bfd_arch_v850, number, "v850", print " (using old gcc ABI)", 2, default, \
+{  32, 32, 8, bfd_arch_v850, number, "v850", print ":old-gcc-abi", 2, default, \
    bfd_default_compatible, bfd_default_scan, bfd_arch_default_fill, next }
 
 #define NEXT NULL
index 3b588874b52c90ed7368c513d073494f9f867d4c..e86749b4a6bb3d0b5d1f28f4c45feeda55f483a3 100644 (file)
@@ -38,4 +38,4 @@ static const bfd_arch_info_type arch_info_struct[] =
 };
 
 const bfd_arch_info_type bfd_v850_rh850_arch =
-  R (bfd_mach_v850,     "v850-rh850",   TRUE,  & arch_info_struct[0]);
+  R (bfd_mach_v850,     "v850:rh850",   TRUE,  & arch_info_struct[0]);
index 8776e4c8818f3c9929e26e962f37b425c80b1cec..f29a3ab2eb1a53f9be0f5b9efb22c43ed6cd5d06 100644 (file)
@@ -1,3 +1,8 @@
+2016-03-09  Pedro Alves  <palves@redhat.com>
+
+       * scripttempl/v850.sc: Use "v850:old-gcc-abi" as OUTPUT_ARCH.
+       * scripttempl/v850_rh850.sc: Use "v850:rh850" as OUTPUT_ARCH.
+
 2016-03-08  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/19789
index e338bf1bd11529bdec54931196c879306d641754..cf7cd20aada4659580b784c2ad834159d3a1b948 100644 (file)
@@ -13,7 +13,7 @@ cat << EOF
 
 OUTPUT_FORMAT("elf32-v850", "elf32-v850",
              "elf32-v850")
-OUTPUT_ARCH(v850)
+OUTPUT_ARCH(v850:old-gcc-abi)
 ${RELOCATING+ENTRY(_start)}
 SEARCH_DIR(.);
 EXTERN(__ctbp __ep __gp);
index 06e52438e3ecb6c0411079d502c43f5e9c065e46..a44b9b5f5b849f872b1188af0a4dc1829a9d339c 100644 (file)
@@ -13,7 +13,7 @@ cat << EOF
 
 OUTPUT_FORMAT("elf32-v850-rh850", "elf32-v850-rh850",
              "elf32-v850-rh850")
-OUTPUT_ARCH(v850-rh850)
+OUTPUT_ARCH(v850:rh850)
 ${RELOCATING+ENTRY(_start)}
 SEARCH_DIR(.);
 EXTERN(__ctbp __ep __gp);