title: Set breakpoint in C or C++ code programmatically for gdb on Linux
body: <p><strong>How can I set a breakpoint in C or C++ code programatically that will work for gdb on Linux?</strong></p>
  
  <p><em>I.e.:</em></p>
  
  <pre><code>int main(int argc, char** argv)
  {
      /* set breakpoint here! */
      int a = 3;
      a++;  /*  In gdb&gt; print a;  expect result to be 3 */
      return 0;
  }
  </code></pre>