aboutsummaryrefslogtreecommitdiff
path: root/gdb/osabi.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2014-06-13 09:28:24 -0600
committerJan Kratochvil <jan.kratochvil@redhat.com>2014-12-12 22:26:11 +0100
commitac04f72bb4396a311ffc445710d4068c13fb0448 (patch)
tree4f83982f12355cab79a0f5cfbcb9011dcb8ecfc6 /gdb/osabi.h
parentf208eee0f3a4f42a0bf20ab900eb36fbba8e4b9e (diff)
downloadgdb-ac04f72bb4396a311ffc445710d4068c13fb0448.zip
gdb-ac04f72bb4396a311ffc445710d4068c13fb0448.tar.gz
gdb-ac04f72bb4396a311ffc445710d4068c13fb0448.tar.bz2
add gnu_triplet_regexp gdbarch method
gdb has to inform libcc1.so of the target being used, so that the correct compiler can be invoked. The compiler is invoked using the GNU configury triplet prefix, e.g., "x86_64-unknown-linux-gnu-gcc". In order for this to work we need to map the gdbarch to the GNU configury triplet arch. In most cases these are identical; however, the x86 family poses some problems, as the BFD arch names are quite different from the GNU triplet names. So, we introduce a new gdbarch method for this. A regular expression is used because there are various valid values for the arch prefix in the triplet. This patch also updates the osabi code to associate a regular expression with the OS ABI. I have only added a concrete value for Linux. Note that the "-gnu" part is optional, at least on Fedora it is omitted from the installed GCC executable's name. gdb/ChangeLog 2014-12-12 Tom Tromey <tromey@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> * osabi.h (osabi_triplet_regexp): Declare. * osabi.c (struct osabi_names): New. (gdb_osabi_names): Change type to struct osabi_names. Update values. (gdbarch_osabi_name): Update. (osabi_triplet_regexp): New function. (osabi_from_tdesc_string, _initialize_gdb_osabi): Update. * i386-tdep.c (i386_gnu_triplet_regexp): New method. (i386_elf_init_abi, i386_go32_init_abi, i386_gdbarch_init): Call set_gdbarch_gnu_triplet_regexp. * gdbarch.sh (gnu_triplet_regexp): New method. * gdbarch.c, gdbarch.h: Rebuild. * arch-utils.h (default_gnu_triplet_regexp): Declare. * arch-utils.c (default_gnu_triplet_regexp): New function.
Diffstat (limited to 'gdb/osabi.h')
-rw-r--r--gdb/osabi.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/osabi.h b/gdb/osabi.h
index 4c03790..8408f0a 100644
--- a/gdb/osabi.h
+++ b/gdb/osabi.h
@@ -49,6 +49,10 @@ void gdbarch_init_osabi (struct gdbarch_info, struct gdbarch *);
/* Return the name of the specified OS ABI. */
const char *gdbarch_osabi_name (enum gdb_osabi);
+/* Return a regular expression that matches the OS part of a GNU
+ configury triplet for the given OSABI. */
+const char *osabi_triplet_regexp (enum gdb_osabi osabi);
+
/* Helper routine for ELF file sniffers. This looks at ABI tag note
sections to determine the OS ABI from the note. It should be called
via bfd_map_over_sections. */