title: How do I install GDB on MacOS 10.13.3 (High Sierra)
body: <p>There are tons and tons of post and blogs discussing this topic, but nothing seems to work...</p>
  
  <p>From across the internet, here is the common consensus regarding the procedure required to install and run <code>gdb</code>.</p>
  
  <ol>
  <li><p>Install <code>gdb</code></p>
  
  <pre><code>brew install gdb
  </code></pre>
  
  <p>Homebrew "successfully" installs <code>gdb v8.1</code></p></li>
  <li><p>Codesign <code>gdb</code></p>
  
  <p>Codesign <code>gdb</code> by following the <a href="https://stackoverflow.com/questions/13913818/how-to-get-a-codesigned-gdb-on-osx/25678528#25678528">codesigning procedure</a> <em>(as detailed in a separate SO post)</em>.</p></li>
  <li><p>Update <code>~/.gdbinit</code></p>
  
  <pre><code>echo "set startup-with-shell off" &gt;&gt; ~/.gdbinit
  </code></pre></li>
  </ol>
  
  <p>After completing all the steps, when I attempt to debug a simple "hello world" program, I get the following startup error resulting from <code>SIGTRAP</code> being throw.</p>
  
  <pre><code>(gdb) start
  Temporary breakpoint 1 at 0x100000e66: file test.cpp, line 5.
  Starting program: /Users/zfields/Documents/Development/test/a.out
  [New Thread 0x1703 of process 67971]
  [New Thread 0x1903 of process 67971]
  During startup program terminated with signal SIGTRAP, Trace/breakpoint trap.
  </code></pre>
  
  <p>What am I missing?</p>