3 ms·
I thought that these HW 'breakpoint' registers were (only) used to implement watchpoint, that is, read/write operations on data. Can they be used to implement
by wazari972 10y ago
I thought that these HW 'breakpoint' registers were (only) used to implement watchpoint, that is, read/write operations on data.
Can they be used to implement 'instruction breakpoints'?
- jasonzemos 10y agoOn register %dr7 there are 4-bit switches for each of the 4 breakpoints. The first two bits can trap on Instruction (0b00), Write (0b01), and ReadWrite (0b11). The second two bits specify the alignment of Byte (0b00), Short (0b01), Long (0b10), and Int (0b11).
- pcwalton 10y agoYou can set the "break on" bitfield to "execute" (0) to have the debug register function as a normal breakpoint.
- burfog 10y agoSure, but normally you wouldn't waste them on that. You might use them for instruction breakpoints in ROM, or when you suspect that the program checksums itself.