This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Delete a watchpoint by address to automate segfault tracking
>>>>> "Laurent" == Laurent G <vrygoud@gmail.com> writes:
Laurent> In the article, the author says "I couldnât find an easy way to track
Laurent> the memory watch number that was created during the first breakpoint,
Laurent> I just built a gdb counter, and deleted the memory watch when leaving,
Laurent> since I could predict gdbâs numbering" and implements watchpoints
Laurent> destruction this way:
I think $bpnum may hold this.
See the 'Set Breaks' node of the manual.
Or it can perhaps be done from Python.
Laurent> How can I do a "delete *`print $d`" in GDB?
A few ways.
Simplest is to use "eval".
Otherwise, Python.
Otherwise, if you have an old gdb and can't upgrade, use set logging to
write out a file with the command you want (using printf), then 'source'
the file.
Tom