Thursday, March 4, 2010

gdb: set a conditional breakpoint

(gdb) break LinkedList<int>::remove
Breakpoint 1 at 0x29fa0: file main.cc, line 52.
(gdb)
(gdb) condition 1 item_to_remove==1


Another way to accomplish this:

break LinkedList<int>::remove if (item_to_remove==1)


source:
http://www.cs.cmu.edu/~gilpin/tutorial/#3.4

No comments: