kgdb,arm: use macro for pc increment

Advance pc of BREAK_INSTR_SIZE in case of compiled breakpoint instead of
hardcoded 4 bytes value.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
Cc: trivial@kernel.org
kgdb,arm: use macro in arch_kgdb_ops

Use byteorder macros to deal with endianness while declaring breakpoint
instruction in arch_kgdb_ops. Use the KGDB_BREAKINST macro instead of
hardcoding the breakpoint instruction in hexadecimal.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
kgdb,arm: compute arch_kgdb_breakpoint instruction size

Replace hardcoded '.word' breakpoint assembly directive by a '.2byte' or
'.4byte' directive, generated from BREAK_INSTR_SIZE.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
kgdb,arm: compute mask from breakpoint size macro

Compute breakpoint instructions masks from the BREAK_INSTR_SIZE macro instead
of hardcoding the mask hex value.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
kgdb,arm: add breakpoint support for thumb2 kernel

Add 16b breakpoint instructions for thumb2 kernel. This repairs the following
error:

  SysRq : DEBUG
  Internal error: Oops - undefined instruction: 0 [#1] SMP THUMB2

...and allows to enter kdb properly under thumb2 kernel for example.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
kgdbts: handle thumb2 kernel

In thumb2, functions addresses have the LSB set; ignore it when comparing with
pc or setting breaks.

This fixes the following kgdbts error:

  kgdbts: BP mismatch c0143020 expected c0143021

...and avoids spurious undefined instructions traps due to "off by one"
breakpoint addresses.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
Config

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
Debug! undef instr

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
Debug! clk_get

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>