Writing a debugger from scratch: Breakpoints

In this part of the series, the author introduces the ability to set hardware breakpoints in the DbgRs debugger. They also make some cleanup changes to improve the code’s clarity and simplicity. The author explains that hardware breakpoints are controlled through the “Debug Registers” on x86 processors. They provide a detailed implementation and explanation of how the breakpoints are applied to the process using the GetThreadContext and SetThreadContext functions. The author also discusses handling breakpoint exceptions and mentions the use of the “resume flag” to resume execution after a breakpoint is hit. The functionality of setting, clearing, and listing breakpoints is implemented and tested.

https://www.timdbg.com/posts/writing-a-debugger-from-scratch-part-5/

To top