diff options
author | Alan Hayward <alan.hayward@arm.com> | 2019-06-26 14:10:08 +0100 |
---|---|---|
committer | Alan Hayward <alan.hayward@arm.com> | 2019-06-26 14:11:07 +0100 |
commit | 3426ae5760319b6b31d71f3ba798154e6fcea34d (patch) | |
tree | 61c2b2347ce87a438fc9e5ae8f969ce0acf95bb7 /gdb/arm-tdep.c | |
parent | 8af58ffe5d06eaed8adfd1f0db2cb10d38c364e2 (diff) | |
download | gdb-3426ae5760319b6b31d71f3ba798154e6fcea34d.zip gdb-3426ae5760319b6b31d71f3ba798154e6fcea34d.tar.gz gdb-3426ae5760319b6b31d71f3ba798154e6fcea34d.tar.bz2 |
Arm: Allow version strings in the triplet regexp
On Arm, the OS may use the full version string for the arch name when
installing the compiler, for example armv7hl-redhat-linux-gnueabi-gcc.
Implement gdbarch_gnu_triplet_regexp for Arm to allow this to be detected.
Ensure that other Arm targets (eg iwmmxt) are not affected.
This fixes the compile/ set of tests on those systems.
gdb/ChangeLog:
2019-06-26 Alan Hayward <alan.hayward@arm.com>
* arm-tdep.c (arm_gnu_triplet_regexp): New function.
(arm_gdbarch_init): Add arm_gnu_triplet_regexp.
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r-- | gdb/arm-tdep.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 2ba77e2..039b2f0 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -8831,7 +8831,17 @@ arm_code_of_frame_writable (struct gdbarch *gdbarch, struct frame_info *frame) return 1; } - +/* Implement gdbarch_gnu_triplet_regexp. If the arch name is arm then allow it + to be postfixed by a version (eg armv7hl). */ + +static const char * +arm_gnu_triplet_regexp (struct gdbarch *gdbarch) +{ + if (strcmp (gdbarch_bfd_arch_info (gdbarch)->arch_name, "arm") == 0) + return "arm(v[^- ]*)?"; + return gdbarch_bfd_arch_info (gdbarch)->arch_name; +} + /* Initialize the current architecture based on INFO. If possible, re-use an architecture from ARCHES, which is a list of architectures already created during this debugging session. @@ -9433,6 +9443,8 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_disassembler_options (gdbarch, &arm_disassembler_options); set_gdbarch_valid_disassembler_options (gdbarch, disassembler_options_arm ()); + set_gdbarch_gnu_triplet_regexp (gdbarch, arm_gnu_triplet_regexp); + return gdbarch; } |