Linux kernel local points

I want to create a simple Linux kernel debugger for x86 architecture. First, I want him to set breakpoints. I was wondering if there is an api kernel for setting up debugger registers and, if so, good documentation? If there is no api kernel for debugger registers, is there any documentation on how to correctly configure the registers manually (using the assembly instruction "MOV")?

+2
debugging linux kernel breakpoints
source share
1 answer

It depends on which kernel versions you would like to process.

There is an API for setting hardware breakpoints in the kernel since version 2.6.33, although it may change slightly in versions 3.0-3.2.

See register_wide_hw_breakpoint () in kernel/events/hw_breakpoint.c and the ones next to it.

The documentation seems rather meager, but there is an example of how to use this API in the kernel, this may help.

A more complex example using this API can be found in the RaceHound project .

+3
source share

All Articles