title: Eclipse gdb won't debug Cygwin executable
body: <p>I created a simple Hello world executable using Cygwin on my Windows 7 PC, building it with: gcc hello.c -g</p>
  
  <p>I can use gdb from the command line on the executable with no problem.</p>
  
  <p>Then in Eclipse Kepler I created a debug configuration with these settings:
  - The C/C++ Application has the full path to the executable
  - It is not connected to a project; the Project box is blank. The workspace doesn't have any projects in it.
  - "Disable auto build" is selected
  - "Stop on startup at: main" is selected
  - The GDB debugger is set to C:\cygwin64\bin\gdb.exe
  - I added the full path to the directory containing hello.c and the executable to the "Source Lookup Path"</p>
  
  <p>My original problem is with using TI's Code Composer Studio, which is based on Eclipse Kepler, to try to debug a unit test executable that is created with a hand written makefile from the shell. Downloading Eclipse Kepler and using a simple hello world program is to strip the problem down to basics. I run into the same problems with CCS or regular Eclipse.</p>
  
  <p>The problem is, when I try to run this debug configuration, this is what the gdb traces console shows me:</p>
  
  <p>290,997 2-gdb-set breakpoint pending on</p>
  
  <p>290,999 2^done</p>
  
  <p>290,999 (gdb)</p>
  
  <p>290,999 3-gdb-set detach-on-fork on</p>
  
  <p>291,000 3^done</p>
  
  <p>291,000 (gdb)</p>
  
  <p>291,000 4-enable-pretty-printing</p>
  
  <p>291,001 4^done</p>
  
  <p>291,001 (gdb)</p>
  
  <p>291,001 5-gdb-set python print-stack none</p>
  
  <p>291,002 5^done</p>
  
  <p>291,002 (gdb)</p>
  
  <p>291,002 6-gdb-set print object on</p>
  
  <p>291,003 6^done</p>
  
  <p>291,003 (gdb)</p>
  
  <p>291,003 7-gdb-set print sevenbit-strings on</p>
  
  <p>291,004 7^done</p>
  
  <p>291,004 (gdb)</p>
  
  <p>291,004 8-gdb-set host-charset UTF-8</p>
  
  <p>291,005 8^done</p>
  
  <p>291,005 (gdb)</p>
  
  <p>291,005 9-gdb-set target-charset WINDOWS-1252</p>
  
  <p>291,006 9^done</p>
  
  <p>291,006 (gdb)</p>
  
  <p>291,006 10-gdb-set target-wide-charset UTF-16</p>
  
  <p>291,007 10^done</p>
  
  <p>291,007 (gdb)</p>
  
  <p>291,007 11source .gdbinit</p>
  
  <p>291,008 &amp;"source .gdbinit\n"</p>
  
  <p>291,008 &amp;".gdbinit: No such file or directory.\n"</p>
  
  <p>291,008 11^error,msg=".gdbinit: No such file or directory."</p>
  
  <p>291,009 (gdb)</p>
  
  <p>291,009 12-gdb-set target-async off</p>
  
  <p>291,010 12^done</p>
  
  <p>291,010 (gdb)</p>
  
  <p>291,010 13-gdb-set auto-solib-add on</p>
  
  <p>291,011 13^done</p>
  
  <p>291,011 (gdb)</p>
  
  <p>291,016 14-file-exec-and-symbols --thread-group i1 C:/IntelligentD/scratch/a.exe</p>
  
  <p>291,051 14^done</p>
  
  <p>291,051 (gdb)</p>
  
  <p>291,051 15-gdb-show --thread-group i1 language</p>
  
  <p>291,052 15^done,value="auto"</p>
  
  <p>291,052 (gdb)</p>
  
  <p>291,052 16-gdb-set --thread-group i1 language c</p>
  
  <p>291,053 16^done</p>
  
  <p>291,053 (gdb)</p>
  
  <p>291,053 17-data-evaluate-expression --thread-group i1 "sizeof (void*)"</p>
  
  <p>291,054 17^done,value="8"</p>
  
  <p>291,054 (gdb)</p>
  
  <p>291,054 18-gdb-set --thread-group i1 language auto</p>
  
  <p>291,055 18^done</p>
  
  <p>291,055 (gdb)</p>
  
  <p>291,055 19-interpreter-exec --thread-group i1 console "show endian"</p>
  
  <p>291,056 ~"The target endianness is set automatically (currently little endian)\n"</p>
  
  <p>291,056 19^done</p>
  
  <p>291,056 (gdb)</p>
  
  <p>291,057 20-break-insert --thread-group i1 -t -f main</p>
  
  <p>291,058 20^done,bkpt=
  {number="1",type="breakpoint",disp="del",enabled="y",addr="0x00000001004010dd",\
  func="main",file="hello.c",fullname="/cygdrive/c/IntelligentD/scratch/hello.c",line="5",thread-group\
  s=["i1"],times="0",original-location="main"}</p>
  
  <p>291,059 (gdb)</p>
  
  <p>291,060 21-exec-run --thread-group i1</p>
  
  <p>291,075 =thread-group-started,id="i1",pid="10376"</p>
  
  <p>291,077 22-list-thread-groups --available</p>
  
  <p>291,077 =thread-created,id="1",group-id="i1"</p>
  
  <p>291,077 ~"[New Thread 10376.0x22c8]\n"</p>
  
  <p>291,077 21^running</p>
  
  <p>291,077 *running,thread-id="all"</p>
  
  <p>291,077 (gdb)</p>
  
  <p>291,080 =thread-exited,id="1",group-id="i1"</p>
  
  <p>291,080 =thread-group-exited,id="i1"</p>
  
  <p>291,080 21^error,msg="During startup program exited with code 0xc0000135."</p>
  
  <p>291,080 (gdb)</p>
  
  <p>291,080 22^error,msg="Can not fetch data now."</p>
  
  <p>291,080 (gdb)</p>
  
  <p>291,088 23-gdb-exit</p>
  
  <p>291,090 23^exit</p>
  
  <p>Following some advice I read, at the command line I started gdb with:
   gdb --interpreter=mi a.exe
  and entered the same commands that show up in the log. When I get to command 21 I get different output:</p>
  
  <p>(gdb)
  21-exec-run --thread-group i1
  =thread-group-started,id="i1",pid="7244"
  =thread-created,id="1",group-id="i1"
  ~"[New Thread 7244.0xca4]\n"
  21^running
  *running,thread-id="all"
  (gdb)
  =library-loaded,id="/cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll",target-name="/cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll",host-name="/cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll",symbols-loaded="0",thread-group="i1"
  =library-loaded,id="/cygdrive/c/WINDOWS/system32/kernel32.dll",target-name="/cygdrive/c/WINDOWS/system32/kernel32.dll",host-name="/cygdrive/c/WINDOWS/system32/kernel32.dll",symbols-loaded="0",thread-group="i1"
  =library-loaded,id="/cygdrive/c/WINDOWS/system32/KERNELBASE.dll",target-name="/cygdrive/c/WINDOWS/system32/KERNELBASE.dll",host-name="/cygdrive/c/WINDOWS/system32/KERNELBASE.dll",symbols-loaded="0",thread-group="i1"
  =library-loaded,id="/cygdrive/c/WINDOWS/System32/SYSFER.DLL",target-name="/cygdrive/c/WINDOWS/System32/SYSFER.DLL",host-name="/cygdrive/c/WINDOWS/System32/SYSFER.DLL",symbols-loaded="0",thread-group="i1"
  =library-loaded,id="/usr/bin/cygwin1.dll",target-name="/usr/bin/cygwin1.dll",host-name="/usr/bin/cygwin1.dll",symbols-loaded="0",thread-group="i1"
  =library-loaded,id="/cygdrive/c/WINDOWS/system32/psapi.dll",target-name="/cygdrive/c/WINDOWS/system32/psapi.dll",host-name="/cygdrive/c/WINDOWS/system32/psapi.dll",symbols-loaded="0",thread-group="i1"
  =thread-created,id="2",group-id="i1"
  ~"[New Thread 7244.0x1ba8]\n"
  *running,thread-id="all"
  =breakpoint-modified,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x00000001004010dd",func="main",file="hello.c",fullname="/cygdrive/c/scratch/hello.c",line="5",thread-groups=["i1"],times="1",original-location="main"}
  ~"\nTemporary breakpoint "
  ~"1, main () at hello.c:5\n"
  ~"5\t  printf(\"Hello world\n\");\n"
  *stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x00000001004010dd",func="main",args=[],file="hello.c",fullname="/cygdrive/c/scratch/hello.c",line="5"},thread-id="1",stopped-threads="all"
  =breakpoint-deleted,id="1"</p>
  
  <p>(gdb)</p>
  
  <p>Does this mean there's a bug in how Eclipse Kepler interacts with gdb? I don't know what this means, or where to go from here.</p>