title: How to install gdb on OSX 10.9
body: <p>How to install gdb on OSX 10.9?</p>
  
  <p>I try to use macports:</p>
  
  <pre><code>port install gdb
  Password:
  ...
  ---&gt;  Updating database of binaries: 100.0%
  ---&gt;  Scanning binaries for linking errors: 100.0%
  ---&gt;  No broken files found.
  </code></pre>
  
  <p>But I don't have gdb executable:</p>
  
  <pre><code>$ which gdb
  $ 
  </code></pre>
  
  <p>I  <a href="https://www.openlearning.com/u/alan.liu/blog/HowtoInstallGdb75InOsx/" rel="nofollow noreferrer">found out</a> that macports gdb on mac is called ggdb. So I make a link:</p>
  
  <pre><code>sudo ln -s /opt/local/bin/ggdb /opt/local/bin/gdb
  
  $ gdb --args ./prog -time
  GNU gdb (GDB) 7.6
  Copyright (C) 2013 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-apple-darwin13.0.0".
  For bug reporting instructions, please see:
  &lt;http://www.gnu.org/software/gdb/bugs/&gt;...
  Reading symbols from /prog...done.
  (gdb) r
  Starting program: /prog -time
  Unable to find Mach task port for process-id 65740: (os/kern) failure (0x5).
   (please check gdb is codesigned - see taskgated(8))
  (gdb) 
  </code></pre>
  
  <p>So how to install gdb correctly on OSX 10.9?</p>
  
  <p>P.S. Related questions, which doesn't help:</p>
  
  <p><a href="https://stackoverflow.com/questions/13913818/how-to-get-a-codesigned-gdb-on-osx">How to get a &quot;codesigned&quot; gdb on OSX?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/18423124/please-check-gdb-is-codesigned-see-taskgated8-how-to-get-gdb-installed-w">&quot;please check gdb is codesigned - see taskgated(8)&quot; - How to get gdb installed with homebrew code signed?</a></p>