gdb python on mac: error of "/usr/local/bin/python": not in executable format
<p>I have the latest gdb installed on mac</p>

<pre><code> qiwu$ brew install gdb
 Warning: gdb-7.12 already installed
</code></pre>

<p>Then I am trying to attach to a python3.5 process</p>

<pre><code>qiwu$ gdb python 4411
GNU gdb (GDB) 7.12
Copyright (C) 2016 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-darwin15.6.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
&lt;http://www.gnu.org/software/gdb/bugs/&gt;.
Find the GDB manual and other documentation resources online at:
&lt;http://www.gnu.org/software/gdb/documentation/&gt;.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
"/usr/local/bin/python": not in executable format: File format not recognized
Attaching to process 4411
Can't attach to process 4411: No such process (3)
/Users/qiwu/4411: No such file or directory.
(gdb)
</code></pre>

<p>Could be because unix systems recognize <code>#!/usr/local/bin/python</code> not <code>/usr/local/bin/python</code></p>

python osx gdb