gdb.info: Tracepoint Passcounts

Go forward to Tracepoint Actions
Go backward to Enable and Disable Tracepoints
Go up to Set Tracepoints
Go to the top op gdb

Tracepoint Passcounts

`passcount [N [NUM]]'
     Set the "passcount" of a tracepoint.  The passcount is a way to
     automatically stop a trace experiment.  If a tracepoint's
     passcount is N, then the trace experiment will be automatically
     stopped on the N'th time that tracepoint is hit.  If the
     tracepoint number NUM is not specified, the `passcount' command
     sets the passcount of the most recently defined tracepoint.  If no
     passcount is given, the trace experiment will run until stopped
     explicitly by the user.
     Examples:
          (gdb) passcount 5 2 // Stop on the 5th execution of
                                        `// tracepoint 2'

(gdb) passcount 12 // Stop on the 12th execution of the
`// most recently defined tracepoint.'
(gdb) trace foo
(gdb) pass 3
(gdb) trace bar
(gdb) pass 2
(gdb) trace baz
(gdb) pass 1 // Stop tracing when foo has been
`// executed 3 times OR when bar has'
`// been executed 2 times'
`// OR when baz has been executed 1 time.'