Conditional Breakpoints
Type in the following,
assuming You have to apply a breakpoint at the line inside the function
(gdb) break <function-name>
GDB will reply with as follows
Breakpoint 1 at 0xaddr: filename , linenumber.
Note the number of the breakpoint
( in this case it is 1 )
Enter the following command
( replace the breakpoint-number appropriately )
(gdb) condition 1 <condition>
During run-time you can skip (step-over) to the 3rd line using the next command twice
(gdb) next
(gdb) next
..and you are at the function’s 3rd line!!
UPDATE:
Additionally, to break when the variable changes value use this:
(gdb) watch variable==value
For more details please refer :
- GDB:Conditional Breakpoints
- Hacking into an executable using GDB
GoodLUCK!!
- CVS