title: How to break when a specific exception type is thrown in GDB?
body: <p>According to the documentation I can break on specific exception type by using conditional breakpoints. However the syntax for the condition isn't very clear to me:</p>
  
  <pre><code>condition bnum &lt;expression&gt;
  </code></pre>
  
  <p>Looking at the expression syntax I think this is the pattern I need:</p>
  
  <blockquote>
    <p><code>{type} addr</code></p>
  </blockquote>
  
  <p>However, I don't know what I should pass for the <code>addr</code> argument. I tried the following:</p>
  
  <pre><code>(gdb) catch throw
  (gdb) condition 1 boost::bad_function_call *
  </code></pre>
  
  <p>But it doesn't work (gdb breaks on all exception types).</p>
  
  <p>Can anyone help?</p>
  
  <p><hr/><h3>Update</h3>
  I also tried @Adam's suggestion, but it results in an error message:</p>
  
  <pre><code>(gdb) catch throw boost::bad_function_call
  Junk at end of arguments.
  </code></pre>
  
  <p>Without <code>boost::</code> namespace:</p>
  
  <pre><code>(gdb) catch throw bad_function_call
  Junk at end of arguments.
  </code></pre>
  
  <p><hr/><h3>Workaround</h3>
  Breaking in the constructor of <code>bad_function_call</code> works.</p>