From: Colin M. <col...@pi...> - 2009-05-21 15:56:28
|
Alex Bennee wrote: > Yep I had been trying that. The main problem was not being able to do > ith progamatically: > > b 869 if awatch (void *) *&n->timer > > Would of been useful. But conditinal breakpoints aren't really > designed for setting newer breakpoints. > > > In GDB you can use the "comm(and)" command to run an GDB command when a break point is hit, for example, if you want to watch the first time the function "goo" is entered after "foo" has been entered, do this b foo b goo disable 2 comm 1 enable 2 cont <blank line> run This sets breakpoint 1 on "foo", breakpoint 2 on "goo". It then disables breakpoint 2. breakpoint 1, when hit, runs "enable 2" and "cont" to re-enable breakpoint 2, and then continue the debuggee. The should work if breakpoint 1 is conditional. HTH, Colin S. Miller |