Linux内核硬件断点 [英] Linux kernel hardware break points
问题描述
这取决于你想要处理的内核版本。
至少从2.6.33开始,内核中设置了一个用于设置硬件断点的API虽然它可能已经改变了版本3.0-3.2。
看看 register_wide_hw_breakpoint()函数在$ code> kernel / events / hw_breakpoint.c 和附近的那些。
文档似乎相当稀缺,但是有一个一个例子如何在内核中使用该API,可能会有所帮助。
可以找到使用该API的更复杂的示例在 RaceHound项目。
I want to build a simple linux kernel debugger for the x86 architecture. I first want it to set break points. I was wondering if there is a kernel api for configuring the debugger registers and if so any good documentation? If there is no kernel api for debugger registers is there any documentation on how to properly configure the registers manually(using the assembly "MOV" instruction)?
It depends on which kernel versions you would like to handle.
There is an API for setting hardware breakpoints in the kernel at least since 2.6.33, although it might have changed a bit around versions 3.0-3.2.
Take a look at register_wide_hw_breakpoint() function in kernel/events/hw_breakpoint.c
and the ones near it.
The documentation seems to be quite scarce but there is an example of how to use that API in the kernel, it may help.
A more complex example using that API can be found in RaceHound project.
这篇关于Linux内核硬件断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!