diff options
author | John Baldwin <jhb@FreeBSD.org> | 2017-10-09 09:54:42 -0700 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2017-10-09 09:54:42 -0700 |
commit | a181c0bf7461c28cdb72a4074c6d7608119fb575 (patch) | |
tree | d6dfd5920579797064ca2b27a0730b547885f2c3 /gdb/fbsd-tdep.c | |
parent | 6e66f7538112d2f5fb1af17dbde33ba37a7171be (diff) | |
download | binutils-a181c0bf7461c28cdb72a4074c6d7608119fb575.zip binutils-a181c0bf7461c28cdb72a4074c6d7608119fb575.tar.gz binutils-a181c0bf7461c28cdb72a4074c6d7608119fb575.tar.bz2 |
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.
Diffstat (limited to 'gdb/fbsd-tdep.c')
-rw-r--r-- | gdb/fbsd-tdep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c index fa4cd91..fa70f7c 100644 --- a/gdb/fbsd-tdep.c +++ b/gdb/fbsd-tdep.c @@ -143,7 +143,7 @@ fbsd_core_xfer_siginfo (struct gdbarch *gdbarch, gdb_byte *readbuf, { size_t siginfo_size; - if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) + if (gdbarch_long_bit (gdbarch) == 32) siginfo_size = SIZE32_SIGINFO_T; else siginfo_size = SIZE64_SIGINFO_T; @@ -168,7 +168,7 @@ fbsd_core_xfer_siginfo (struct gdbarch *gdbarch, gdb_byte *readbuf, len = siginfo_size - offset; ULONGEST siginfo_offset; - if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) + if (gdbarch_long_bit (gdbarch) == 32) siginfo_offset = LWPINFO_OFFSET + LWPINFO32_PL_SIGINFO; else siginfo_offset = LWPINFO_OFFSET + LWPINFO64_PL_SIGINFO; |