ARM EABI Linux, breakpoints cause SIGILL and target dies

Ulrich Weigand
Fri Jan 20 10:45:00 GMT 2012

Nicholas Sherlock wrote:

> Running a.out alone or with GDB works fine, but any operation that
> causes GDB to set a breakpoint results in the target being killed by
> So I would expect that this would work. Another piece of the puzzle, I
> have a different phone here running a different Linux kernel, but the
> same Ubuntu usermode binaries, where GDB breakpoints work perfectly:
> How do I begin to debug this problem? I have the source code available
> for both kernels if there is something to investigate there.

So there's two issues here:

- The kernel is supposed to recognize the special undefined instructions
  use to implement breakpoints, and deliver SIGTRAP instead of SIGILL if
  execution hits one of those.  It may be that the older of the two kernels
  does not properly handle this, in particular for Thumb-2 breakpoints
  which were added only recently.

  If you have the kernel sources, you might want to compare the routines
  installed via register_undef_hook in arch/arm/kernel/ptrace.c.

- Even on old kernels that return SIGILL, there is apparently some code
  in GDB that tries to recognize breakpoints anyway.  It may well be
  that this code does not (any longer) work correctly; it is never
  exercised on recent kernels, so a bug might have crept in ...

  Can you do a run with "set debug infrun 1" in the case where you
  get the SIGILL?


  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE

More information about the Gdb mailing list