title: gdb 8.2 can't recognized executable file on macOS Mojave 10.14
body: <p>I get gdb by <code>brew install gdb</code>.</p>
  
  <p>The source file content is:</p>
  
  <pre><code>#include &lt;cstdio&gt;
  int main(){
      int a = 10;
      for(int i = 0; i&lt; 10; i++){
          a += i;
      }
      printf("%d\n",a);
      return 0;
  }
  </code></pre>
  
  <p>Here is the executable file named 'demo':
  <a href="https://pan.baidu.com/s/1wg-ffGCYzPGDI77pRxhyaw" rel="noreferrer">https://pan.baidu.com/s/1wg-ffGCYzPGDI77pRxhyaw</a></p>
  
  <p>I compile the source file like this:</p>
  
  <pre><code>c++ -g -o demo demo.cpp
  </code></pre>
  
  <p>And run gdb</p>
  
  <pre><code>gdb ./demo
  </code></pre>
  
  <p>But, it can't work. It can't recognized the executable file.</p>
  
  <pre><code>GNU gdb (GDB) 8.2
  Copyright (C) 2018 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-darwin18.0.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"...
  BFD: /Users/xxx/Codes/demo: unknown load command 0x32
  BFD: /Users/xxx/Codes/demo: unknown load command 0x32
  "/Users/xxx/Codes/demo": not in executable format: file format not recognized
  </code></pre>
  
  <p>I use <code>file demo</code>,its ouput is <code>demo: Mach-O 64-bit executable x86_64</code></p>
  
  <p>I use <code>file ./demo</code>,its output is <code>./demo: Mach-O 64-bit executable x86_64</code></p>
  
  <p>Type <code>c++ -v</code>, output is :</p>
  
  <pre><code>Apple LLVM version 10.0.0 (clang-1000.10.44.2)
  Target: x86_64-apple-darwin18.0.0
  Thread model: posix
  InstalledDir: /Library/Developer/CommandLineTools/usr/bin
  </code></pre>
  
  <p>run <code>./demo</code>,its output is <code>55</code>
  type <code>show configuration</code> in gdb,it shows:</p>
  
  <pre><code> This GDB was configured as follows:
   configure --host=x86_64-apple-darwin18.0.0 --target=x86_64-apple-darwin18.0.0
           --with-auto-load-dir=:${prefix}/share/auto-load
           --with-auto-load-safe-path=:${prefix}/share/auto-load
           --with-expat
           --with-gdb-datadir=/usr/local/Cellar/gdb/8.2/share/gdb (relocatable)
           --with-jit-reader-dir=/usr/local/Cellar/gdb/8.2/lib/gdb (relocatable)
           --without-libunwind-ia64
           --without-lzma
           --without-babeltrace
           --without-intel-pt
           --disable-libmcheck
           --without-mpfr
           --with-python=/System/Library/Frameworks/Python.framework/Versions/2.7
           --without-guile
           --with-separate-debug-dir=/usr/local/Cellar/gdb/8.2/lib/debug (relocatable)
  </code></pre>
  
  <p>Who can help me ? Thank you very much !!!</p>