diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-07-04 21:02:43 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-07-09 09:41:55 +0100 |
commit | b3a7d1711e4557811865333a0ac96fc16b750869 (patch) | |
tree | 316090eef101d1750d3b790d8935d1800d07a1a4 /gdb/fbsd-nat.h | |
parent | d69cd47e7e9884f7b3a319936f70b8d93347e9e0 (diff) | |
download | gdb-b3a7d1711e4557811865333a0ac96fc16b750869.zip gdb-b3a7d1711e4557811865333a0ac96fc16b750869.tar.gz gdb-b3a7d1711e4557811865333a0ac96fc16b750869.tar.bz2 |
gdb/riscv: Don't use default bfd to define required features
When we initialise a gdbarch object we perform a check to try and
detect if the user is doing something silly; trying to run an RV64
binary on an RV32 target. To perform this check we compare the xlen
from the target description with the xlen specified in the headers on
the ELF being debugged.
If there is no ELF being debugged then we (currently) try to use the
bfd_arch_info from the gdbarch_info object, which will have been set
to the default architecture if no bfd is currently being debugged.
For RISC-V the default architecture is RV64.
What this means is that if a user tries to connect to an RV32 target
without specifying the BFD to debug then GDB will assume RV64. The
sanity check mentioned above will failed (xlen difference) and GDB
will throw an error. The error causes GDB to disconnect from the
remote target.
After this commit GDB no longer relies on the default bfd
architecture. If the user tries to connect without specifying the bfd
then GDB will simply make use of the xlen extracted from the target
description in order to find or create a suitable gdbarch object.
gdb/ChangeLog:
* riscv-tdep.c (riscv_features_from_gdbarch_info): Don't modify
required features based on default bfd type when no specific bfd
is present.
Diffstat (limited to 'gdb/fbsd-nat.h')
0 files changed, 0 insertions, 0 deletions