]> git.baikalelectronics.ru Git - kernel.git/commit
kgdb: fix kgdb_validate_break_address to perform a mem write
authorJason Wessel <jason.wessel@windriver.com>
Fri, 1 Aug 2008 13:39:34 +0000 (08:39 -0500)
committerJason Wessel <jason.wessel@windriver.com>
Fri, 1 Aug 2008 13:39:34 +0000 (08:39 -0500)
commit69bb17e8b44149754b7372bf74f98b9712f2d938
tree6862f0442a9ab4e2da20fb93e3cf3be2c36b76b2
parentcd9103858d467de289d9a0fcef5b271c7a7d8264
kgdb: fix kgdb_validate_break_address to perform a mem write

A regression to the kgdb core was found in the case of using the
CONFIG_DEBUG_RODATA kernel option.  When this option is on, a breakpoint
cannot be written into any readonly memory page.  When an external
debugger requests a breakpoint to get set, the
kgdb_validate_break_address() was only checking to see if the address
to place the breakpoint was readable and lacked a write check.

This patch changes the validate routine to try reading (via the
breakpoint set request) and also to try immediately writing the break
point.  If either fails, an error is correctly returned and the
debugger behaves correctly.  Then an end user can make the
descision to use hardware breakpoints.

Also update the documentation to reflect that using
CONFIG_DEBUG_RODATA will inhibit the use of software breakpoints.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Documentation/DocBook/kgdb.tmpl
kernel/kgdb.c