title: win10 gdb not in executable format: File format not recognized
body: <p>I'm a C newbie who recently installed gcc and gdb on windows 10 through MinGW. However, when I tried to debug my program using gdb through win10 cmd I got an error.</p>
  
  <p>Here's what I did on cmd:</p>
  
  <pre><code>gcc ./test.c
  gdb ./a.exe
  </code></pre>
  
  <p>And I got this:</p>
  
  <blockquote>
    <p>not in executable format: File format not recognized</p>
  </blockquote>
  
  <p>Then I tried to install gdb on bash as well and did the following:</p>
  
  <pre><code>gcc ./test.c
  gdb ./a.out
  </code></pre>
  
  <p>(gcc through bash would create a.out but would create a.exe through cmd)</p>
  
  <p>This time gdb seems to be able to start the executable file correctly, however when I tried typing in break commands I got another error message:</p>
  
  <blockquote>
    <p>No symbol table is loaded.  Use the "file" command.</p>
  </blockquote>
  
  <p>Can anyone help to solve the problem?
  PS. I've tried using file  but it didn't work either.
  PSS.after using <code>gcc -g ./test.c</code> the gdb seems to be working correctly on bash. However the windows one still can't run .exe file.</p>