From a181c0bf7461c28cdb72a4074c6d7608119fb575 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 9 Oct 2017 09:54:42 -0700 Subject: Use gdbarch_long_bit to determine layout of FreeBSD siginfo_t. FreeBSD architectures are either ILP32 or LP64 resulting in two different layouts for siginfo_t. Previously, the 'bits_per_word' member of bfd_arch_info was used to determine the layout to use for a given FreeBSD architecture. However, mipsn32 architectures inherit from a 64-bit mips architecture where bits_per_word is 64. As a result, $_siginfo was not properly extracted from FreeBSD/mipsn32 core dumps. Fix this by using gdbarch_long_bit instead of 'bits_per_word' to determine if a FreeBSD architecture is ILP32 or LP64. gdb/ChangeLog: * fbsd-nat.c (fbsd_siginfo_size): Use gdbarch_long_bit. (fbsd_convert_siginfo): Likewise. * fbsd-tdep.c (fbsd_core_xfer_siginfo): Likewise. --- gdb/fbsd-nat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/fbsd-nat.c') diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c index 5ad0dda..265175a 100644 --- a/gdb/fbsd-nat.c +++ b/gdb/fbsd-nat.c @@ -279,7 +279,7 @@ fbsd_siginfo_size () struct gdbarch *gdbarch = get_frame_arch (get_current_frame ()); /* Is the inferior 32-bit? If so, use the 32-bit siginfo size. */ - if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) + if (gdbarch_long_bit (gdbarch) == 32) return sizeof (struct siginfo32); #endif return sizeof (siginfo_t); @@ -296,7 +296,7 @@ fbsd_convert_siginfo (siginfo_t *si) struct gdbarch *gdbarch = get_frame_arch (get_current_frame ()); /* Is the inferior 32-bit? If not, nothing to do. */ - if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word != 32) + if (gdbarch_long_bit (gdbarch) != 32) return; struct siginfo32 si32; -- cgit v1.1