linux/arch/arm/include
David Rivshin d6a0144b34 ARM: 8764/1: kgdb: fix NUMREGBYTES so that gdb_regs[] is the correct size
commit 76ed0b803a upstream.

NUMREGBYTES (which is used as the size for gdb_regs[]) is incorrectly
based on DBG_MAX_REG_NUM instead of GDB_MAX_REGS. DBG_MAX_REG_NUM
is the number of total registers, while GDB_MAX_REGS is the number
of 'unsigned longs' it takes to serialize those registers. Since
FP registers require 3 'unsigned longs' each, DBG_MAX_REG_NUM is
smaller than GDB_MAX_REGS.

This causes GDB 8.0 give the following error on connect:
"Truncated register 19 in remote 'g' packet"

This also causes the register serialization/deserialization logic
to overflow gdb_regs[], overwriting whatever follows.

Fixes: 834b2964b7 ("kgdb,arm: fix register dump")
Signed-off-by: David Rivshin <drivshin@allworx.com>
Acked-by: Rabin Vincent <rabin@rab.in>
Tested-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-11-20 18:04:58 +00:00
..
asm ARM: 8764/1: kgdb: fix NUMREGBYTES so that gdb_regs[] is the correct size 2018-11-20 18:04:58 +00:00
debug Samsung Exynos updates for 3.16 2014-05-30 21:44:49 -07:00
uapi/asm ARM: 8097/1: unistd.h: relocate comments back to place 2014-09-05 16:36:28 -07:00