This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tdep/21818] New: disassemble with v5TE remote: Assertion `info->mach == bfd_get_mach (exec_bfd)' failed.


https://sourceware.org/bugzilla/show_bug.cgi?id=21818

            Bug ID: 21818
           Summary: disassemble with v5TE remote: Assertion `info->mach ==
                    bfd_get_mach (exec_bfd)' failed.
           Product: gdb
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tdep
          Assignee: unassigned at sourceware dot org
          Reporter: b7.10110111 at gmail dot com
  Target Milestone: ---

When debugging a remote ARM binary with Tag_CPU_arch set to v5TE, attempt to
use `disassemble` command result in assertion failure.

Steps to reproduce:

* On remote machine:
gcc -x c -o test -march=armv5te -nostdlib - <<< 'int _start(){}'
gdbserver :1337 ./test

* On local machine:
arm-unknown-linux-gnueabihf-gdb -q -ex 'target remote rpi:1337' -ex disas

`rpi` above is my remote machine's hostname. Here's the output I get from
`disas`:

Dump of assembler code for function _start:
=> 0x000100b8 <+0>:     push    {r11}           ; (str r11, [sp, #-4]!)
   0x000100bc <+4>:
../../binutils-gdb/gdb/arch-utils.c:979: internal-error: int
default_print_insn(bfd_vma, disassemble_info*): Assertion `info->mach ==
bfd_get_mach (exec_bfd)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

What we have here is that `bfd_get_mach (exec_bfd)` returns
9==bfd_mach_arm_5TE, while `info->mach` has been set to 0==bfd_mach_arm_unknown
at `arm-dis.c:print_insn()` due to `info->flags` being 0.

On newer ARM arches, like 6zk, `bfd_get_mach (exec_bfd)` returns 0, and this
coincides with `info->mach`, so there's no problem.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]