After setting the first (and only possible) hardware watchpoint via watch varname
in GDB, it's not possible to remove it via delete.
Even if I just exit GDB, this watchpoint seems to be enabled till the next reboot. When I try to set another hardware watchpoint after GDB is restarted, a kernel message appears in logs telling me, all hardware watchpoints are already taken. It seems like it's the same problem as in Setting GDB hardware watchpoint/how to set software watchpoint, but because I need a hardware watchpoint, the solution does not apply.
Is there a tool or a syscall to remove this (or all) hardware watchpoint? The CPU is an Core i5 and the Linux kernel is 3.0.0-17-generic from Ubuntu 11.10 (Oneiric Ocelot).
Deleting WatchpointsChoose Goto ® Control debugging ® Watchpoints or the Watchpoints pushbutton to display the watchpoint list. Choose the trashcan icon in the line containing the watchpoint you want to delete.
5.4 How do I disable watchpoints? [top] [toc] Active watchpoints show up the breakpoint list. Use the info breakpoints command to get this list. Then use the disable command to turn off a watchpoint, just like disabling a breakpoint.
Hardware watchpoints - allow execution to halt when a read or write access is made to a data variable address. Count Event - can be used to measure clock cycles between two points in the code. Data Access Count - can be used to determine the number of times a data variable address has been accessed.
With the clear command you can delete breakpoints according to where they are in your program. With the delete command you can delete individual breakpoints, watchpoints, or catchpoints by specifying their breakpoint numbers.
Use watchpoints (sometimes called data breakpoints). It can handle it as normal breakpoints, as follows:
(gdb) info watchpoints
Num Type Disp Enb Address What
2 acc watchpoint keep y x
(gdb) delete 2
(gdb) info watchpoints
No watchpoints.
(gdb)
A good reference is Setting Watchpoints.
After setting the first (and only possible) hardware watchpoint via watch varname in gdb it's not possible to remove it via delete.
The statement above is false. What led you to conclude it is true?
Is there a tool or a syscall to remove this (or all) hardware watchpoint?
No such tool is necessary. Simply quit GDB, and all breakpoints and watchpoints will be gone. Or do (gdb) delete
(without specifying a break point), and confirm that you want to delete all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With