title: How to make a GDB breakpoint only break after the point is reached a given number times?
body: <p>I have a function that is called some large number of times, and eventually segfaults.</p>
  
  <p>However, I don't want to set a breakpoint at this function and stop after every time it's called, because I will be here for years.</p>
  
  <p>I've heard that I can set a <code>counter</code> in GDB for a breakpoint, and each time the breakpoint is hit, the counter is decremented, and only gets triggered when the <code>counter</code> = 0.</p>
  
  <p>Is this accurate, and if so how do I do it? Please give the gdb code for setting such a breakpoint.</p>