Bug 20955 - GDB internal error in cris-tdep.c
Summary: GDB internal error in cris-tdep.c
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: tdep (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 7.12.1
Assignee: Yao Qi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-09 14:05 UTC by Yao Qi
Modified: 2016-12-12 09:15 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yao Qi 2016-12-09 14:05:36 UTC
(gdb) set architecture cris
The target architecture is assumed to be cris
(gdb) disassemble 0,+4
Dump of assembler code from 0x0 to 0x4:
   0x00000000:	
../../binutils-gdb/gdb/cris-tdep.c:3793: 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.
Quit this debugging session? (y or n)
Comment 1 cvs-commit@gcc.gnu.org 2016-12-12 09:11:41 UTC
The master branch has been updated by Yao Qi <qiyao@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d36cab83a963f5bb3773e0218cc02f63b0851d0b

commit d36cab83a963f5bb3773e0218cc02f63b0851d0b
Author: Yao Qi <yao.qi@linaro.org>
Date:   Mon Dec 12 09:09:43 2016 +0000

    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.
Comment 2 cvs-commit@gcc.gnu.org 2016-12-12 09:14:29 UTC
The gdb-7.12-branch branch has been updated by Yao Qi <qiyao@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d47caa54a3fbdcf90b68c240b214d59d8befda7c

commit d47caa54a3fbdcf90b68c240b214d59d8befda7c
Author: Yao Qi <yao.qi@linaro.org>
Date:   Mon Dec 12 09:09:43 2016 +0000

    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.
Comment 3 Yao Qi 2016-12-12 09:15:51 UTC
Patch is pushed in to master and 7.12 branch.