]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
opcodes/csky: return the default disassembler when there is no bfd
authorAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 16 Sep 2020 09:12:39 +0000 (10:12 +0100)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 22 Oct 2020 15:11:34 +0000 (17:11 +0200)
commita9e3b919502b10ff96df7bab3161c5be8e718b3b
treedb00a4c247b0e48206fe2e43ac319ce934fc742a
parent4c02be1198613b582744f90e5a2e3425dcf22c81
opcodes/csky: return the default disassembler when there is no bfd

The disassembler function should return a valid disassembler function
even when there is no BFD present.  This is implied (I believe) by the
comment in dis-asm.h which says the BFD may be NULL.  Further, it
makes sense when considering that the disassembler is used in GDB, and
GDB may connect to a target and perform debugging even without a BFD
being supplied.

This commit makes the csky_get_disassembler function return the
default disassembler configuration when no bfd is supplied, this is
the same default configuration as is used when a BFD is supplied, but
the BFD has no attributes section.

Before the change configuring GDB with --enable-targets=all and
running the tests gdb.base/all-architectures-2.exp results in many
errors, but after this change there are no failures.

opcodes/ChangeLog:

* csky-dis.c (csky_get_disassembler): Don't return NULL when there
is no BFD.
opcodes/ChangeLog
opcodes/csky-dis.c