aboutsummaryrefslogtreecommitdiff
path: root/gdb/ppc-linux-tdep.c
diff options
context:
space:
mode:
authorWill Schmidt <will_schmidt@vnet.ibm.com>2021-08-18 11:43:45 -0500
committerWill Schmidt <will_schmidt@vnet.ibm.com>2021-08-18 11:43:45 -0500
commitbc0df0fa47561817ba263f4de13525d998bd5903 (patch)
tree7e2a7351b553f6d1b6082eca02830b7e20f96949 /gdb/ppc-linux-tdep.c
parenta86733d63d40fd8d3a7a2640ebcc048414fb465f (diff)
downloadgdb-bc0df0fa47561817ba263f4de13525d998bd5903.zip
gdb-bc0df0fa47561817ba263f4de13525d998bd5903.tar.gz
gdb-bc0df0fa47561817ba263f4de13525d998bd5903.tar.bz2
[gdb] [rs6000] Add ppc64*_gnu_triplet_regexp methods.
Add methods to set the target triplet so we can find the proper gcc when our gcc is named of the form powerpc64{le}-<foo>-gcc or ppc64{le}-<foo>-gcc.
Diffstat (limited to 'gdb/ppc-linux-tdep.c')
-rw-r--r--gdb/ppc-linux-tdep.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index e62f45a..4be75d1 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1973,6 +1973,30 @@ ppc_floatformat_for_type (struct gdbarch *gdbarch,
return default_floatformat_for_type (gdbarch, name, len);
}
+/* Specify the powerpc64le target triplet.
+ This can be variations of
+ ppc64le-{distro}-linux-gcc
+ and
+ powerpc64le-{distro}-linux-gcc. */
+
+static const char *
+ppc64le_gnu_triplet_regexp (struct gdbarch *gdbarch)
+{
+ return "p(ower)?pc64le";
+}
+
+/* Specify the powerpc64 target triplet.
+ This can be variations of
+ ppc64-{distro}-linux-gcc
+ and
+ powerpc64-{distro}-linux-gcc. */
+
+static const char *
+ppc64_gnu_triplet_regexp (struct gdbarch *gdbarch)
+{
+ return "p(ower)?pc64";
+}
+
static void
ppc_linux_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
@@ -2103,6 +2127,11 @@ ppc_linux_init_abi (struct gdbarch_info info,
set_gdbarch_gcore_bfd_target (gdbarch, "elf64-powerpcle");
else
set_gdbarch_gcore_bfd_target (gdbarch, "elf64-powerpc");
+ /* Set compiler triplet. */
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE)
+ set_gdbarch_gnu_triplet_regexp (gdbarch, ppc64le_gnu_triplet_regexp);
+ else
+ set_gdbarch_gnu_triplet_regexp (gdbarch, ppc64_gnu_triplet_regexp);
}
set_gdbarch_core_read_description (gdbarch, ppc_linux_core_read_description);