summaryrefslogtreecommitdiffstats
path: root/contrib/gdb
diff options
context:
space:
mode:
authorzbb <zbb@FreeBSD.org>2015-10-30 12:21:37 +0000
committerzbb <zbb@FreeBSD.org>2015-10-30 12:21:37 +0000
commitdbf29557d917055e8603643594313199f544af88 (patch)
tree9ee6e26c7dd9d95b198842d5122fd05ccb8dbf31 /contrib/gdb
parent2b14b99e0af107ce75981efc472db5350544b384 (diff)
downloadFreeBSD-src-dbf29557d917055e8603643594313199f544af88.zip
FreeBSD-src-dbf29557d917055e8603643594313199f544af88.tar.gz
Workaround KGDB issues on ARM by ignoring ARM EABI version higher than 5
To make KGDB working, it needs to understand kernel ELF image. By default it is compiled using EABI_5, which is not supported on the gdb-6. As a workaround, treat these images as EABI_2 because they share a lot of things in common. This workaround does not guarantee ALL funtionalities to work. Submitted by: Wojciech Macek <wma@semihalf.com> Reviewed by: jhb Obtained from: Semihalf Sponsored by: Juniper Networks Inc. Differential Revision: https://reviews.freebsd.org/D4012
Diffstat (limited to 'contrib/gdb')
-rw-r--r--contrib/gdb/gdb/arm-tdep.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/contrib/gdb/gdb/arm-tdep.c b/contrib/gdb/gdb/arm-tdep.c
index 128219f..cec9061 100644
--- a/contrib/gdb/gdb/arm-tdep.c
+++ b/contrib/gdb/gdb/arm-tdep.c
@@ -2580,6 +2580,21 @@ arm_elf_osabi_sniffer (bfd *abfd)
osabi = GDB_OSABI_ARM_EABI_V2;
break;
+ case EF_ARM_EABI_VER3:
+ case EF_ARM_EABI_VER4:
+ case EF_ARM_EABI_VER5:
+ /*
+ * GDB does not support these EABI versions. Fallback
+ * to the highest known to make the KGDB working with
+ * kernel ELF image.
+ */
+ osabi = GDB_OSABI_ARM_EABI_V2;
+ printf ("\n%s:%d "
+ "arm_elf_osabi_sniffer: Unsupported ARM EABI "
+ "version 0x%x, falling back to 0x%x\n",
+ __FILE__, __LINE__, eflags, EF_ARM_EABI_VER2);
+ break;
+
case EF_ARM_EABI_UNKNOWN:
/* Assume GNU tools. */
osabi = GDB_OSABI_ARM_APCS;
OpenPOWER on IntegriCloud