]> git.baikalelectronics.ru Git - kernel.git/commit
gdbstub: do not directly use dbg_reg_def[] in gdb_cmd_reg_set()
authorJason Wessel <jason.wessel@windriver.com>
Thu, 5 Aug 2010 14:22:22 +0000 (09:22 -0500)
committerJason Wessel <jason.wessel@windriver.com>
Thu, 5 Aug 2010 14:22:22 +0000 (09:22 -0500)
commit0fb7290294d1f15b3f5c50c9c22a0d4b67b93a9a
treed510c23f3387520b027ba30403db5981e82d3e90
parent3a1d4078595e94d8af59ef55a18bc687bea9a508
gdbstub: do not directly use dbg_reg_def[] in gdb_cmd_reg_set()

Presently the usable registers definitions on x86 are not contiguous
for kgdb.  The x86 kgdb uses a case statement for the sparse register
accesses.  The array which defines the registers (dbg_reg_def) should
not be used directly in order to safely work with sparse register
definitions.

Specifically there was a problem when gdb accesses ORIG_AX, which is
accessed only through the case statement.

This patch encodes register memory using the size information provided
from the debugger which avoids the need to look up the size of the
register.  The dbg_set_reg() function always further validates the
inputs from the debugger.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
kernel/debug/gdbstub.c