]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Remove assert on exec_bfd in cris_delayed_get_disassembler
authorYao Qi <yao.qi@linaro.org>
Mon, 12 Dec 2016 09:09:43 +0000 (09:09 +0000)
committerYao Qi <yao.qi@linaro.org>
Mon, 12 Dec 2016 09:11:24 +0000 (09:11 +0000)
commitd47caa54a3fbdcf90b68c240b214d59d8befda7c
tree50521cb098ba4f80ea6e74ab25d0b5d3412d09ef
parenta3c5766547a7bea4b1901fdad0b22c061c52eb8b
Remove assert on exec_bfd in cris_delayed_get_disassembler

cris_delayed_get_disassembler has an assert that exec_bfd can't be
NULL, but this assert can be triggered like this,

(gdb) set architecture cris
The target architecture is assumed to be cris
(gdb) disassemble 0x0,+4
Dump of assembler code from 0x0 to 0x4:
   0x00000000:
../../binutils-gdb/gdb/cris-tdep.c:3798: internal-error: int cris_delayed_get_disassembler(bfd_vma, disassemble_info*): Assertion `exec_bfd != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

however, cris_get_disassembler does have code to handle the case that
bfd is NULL,

  /* If there's no bfd in sight, we return what is valid as input in all
     contexts if fed back to the assembler: disassembly *with* register
     prefix.  Unfortunately this will be totally wrong for v32.  */
  if (abfd == NULL)
    return print_insn_cris_with_register_prefix;

This patch is to remove this assert.

gdb:

2016-12-12  Yao Qi  <yao.qi@linaro.org>

PR tdep/20955
* cris-tdep.c (cris_delayed_get_disassembler): Remove the
assert.
gdb/ChangeLog
gdb/cris-tdep.c