Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Cannot run program "gdb": Launching failed

While writing my email below I discovered my problem.  It is somewhat rookie - but then again I think it is also acceptable and something that someone more experienced should have picked up on quickly.  For this reason I will include my orginal email  - so that it is easier for you to recognise when someone else may have the same rookie error.

My problem was that I had not added c:\cygwin\bin to my environment variable path in windows and that I hadn't added /cygdrive/c as a Path Mapping for debugging.  I discovered these requirements in a set of instructions:

Building Simulation Programs On Windows vis Eclispe C/C++ Development Tools (https://ccnet.stanford.edu/cgi-bin/course.cgi?cc=msande223&action="">).
However, the path that the instructions said to add to the environment variables had a typo in it and didn't include the colon.   I stupidly missed picking up on this.  Hence, I thought I had added the environment path - but I had not.  I restarted Eclipse and had the same problems as before.  Then at some stage I removed the environment path again because I thought it may have interfered with something else.  When I re-added it I realised the typo. I got really exciting thinking that I had fixed my problem.  I returned to Eclipse and tried to debug - I got the same error.  So I started writing this email, but then while writing this I just had a brain wave - I hadn't restarted Eclipse since adding the cygwin path as an environment. I did so and tried again and SUCCESS: a day after I began I finally got Eclipse to debug with the Cygwin toolchain.

Could I make a few suggestions - this may exist but I didn't find it until I came across the instructions I mentioned above.  It would be really helpful to have some detailed Eclipse documentation on how to install Cygwin so that it works with Eclipse - including what parts of Cygwin need to be installed (gcc, g++, gdb, make etc...) and the fact that the environment variable needs to be added to the windows path if external programs are to use cygwin commands such as gdb.  Just as an idea this could be linked in to the project properties toolchains preferences area and even into the new project wizard if you have no toolchains installed - like a how to install each toolchain (MinGW is easy (besides gdb which is actually not on the normal install) but Cygwin is a little harder) and even a checklist saying that for instance gcc is installed but make is missing.  I had a problem the first time I installed cygwin where I didn't realise I needed make.  I had everything else, including automake etc... installed but didn't see make in the cygwin installer.  Hence, Eclispe said I didn't have the Cygwin toolchain installed when I tried to start a project.  It would have been nice to see Eclipse say - you need to install make you dumbarse ;)

Further, when the Cygwin toolchain is found most setups occur automatically (like gcc, g++) - this is excellent btw.  However, for Cygwin the debug setup doesn't seem to.  The path needs to be changed to c:\cygwin\bin\gdb and the path mapping of /cygdrive/c (with c:\ as the local file system path) must be added.  Couldn't this also automatically be configured as the default for Eclipse with Cygwin on a Windows platform.  If not perhaps more documentation that explains how to do it.  I hope all of these suggestions do not sound ungrateful.  I am only trying to make an excellent IDE even better ;)

I was also just thinking that it is strange that I could build using gcc, make etc... but couldn't debug(run gdb) when I didn't have the environment variable added.

Finally if you have been reading my past emails - the spaces thing doesn't matter - both the spaces and no spaces projects work fine now.  However, as Dmitry suggests I will always use no spaces just to rule that out as a potential error.

Thanks for all your help and sorry about the rant.  Just a bit frustrated that these setup options weren't a little more intuitive.

Thanks to everyone who tried to help,

Dylan



Below is my original email that I was writing:

Okay so I have another project which has no spaces. C:\Users\Entecho\Desktop\Programming\EclipseWorkspace\HelloWorldTest
This project still has the same problems.

I had already done what you asked but not reported it back yet.  This is with the project that included spaces but the operations are only only the exe which is spaceless.

This is a capture of the cygwin gdb run.  NOTE:  it run fine the first time, but had problems the next times - I have no idea if this is normal behaviour or if it is a problem and if it is a problem if it could cause Eclipse to not run gdb properly.  After trying a few times I quit gdb.  I can also run the exe from the windows cmd and from windows explorer with a double click and it runs fine (as long as I have added c:\cygwin\bin to my windows environment variable - using Vista as well btw).  Until I added this to the environment variable it wouldn't work - some error about not having the cygwin dll.  I thought this may have solved my problems - but it didn't. [Actually it did I just hadn't restarted Eclipse]

GDB in Cygwin output:

Entecho@E21 /cygdrive/c/Test
$ gdb HWTestAgain.exe
GNU gdb 6.5.50.20060706-cvs (cygwin-special)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) run
Starting program: /cygdrive/c/Test/HWTestAgain.exe
Loaded symbols for /cygdrive/c/Windows/system32/ntdll.dll
Loaded symbols for /cygdrive/c/Windows/system32/kernel32.dll
Loaded symbols for /usr/bin/cygwin1.dll
Loaded symbols for /cygdrive/c/Windows/system32/advapi32.dll
Loaded symbols for /cygdrive/c/Windows/system32/rpcrt4.dll
!!!Hello World!!!

Program exited normally.
(gdb) run
Starting program: /cygdrive/c/Test/HWTestAgain.exe
Loaded symbols for /cygdrive/c/Windows/system32/ntdll.dll
Error: dll starting at 0x48001000 not found.
!!!Hello World!!!

Program exited normally.
(gdb) run
warning: cannot close "/cygdrive/c/Windows/system32/ntdll.dll": Bad file descrip
tor
Starting program: /cygdrive/c/Test/HWTestAgain.exe
Loaded symbols for /cygdrive/c/Windows/system32/ntdll.dll
Error: dll starting at 0x48001000 not found.
!!!Hello World!!!

Program exited normally.
(gdb) run
warning: cannot close "/cygdrive/c/Windows/system32/ntdll.dll": Bad file descrip
tor
Starting program: /cygdrive/c/Test/HWTestAgain.exe
Loaded symbols for /cygdrive/c/Windows/system32/ntdll.dll
Error: dll starting at 0x48001000 not found.
!!!Hello World!!!

Program exited normally.
(gdb) quit



Dmitry Smirnov wrote:
First, I would recommend to move the project to the path that does not
use spaces.
Could you please also
1. run the program with no debugger (from windows console, for example)
2. run the program with console gdb (just run command line in the
directory with HelloWorld.exe, enter "gdb HelloWorld.exe" (or
"C:\cygwin\bin\gdb.exe HelloWorld.exe" and then issue a "run" command
in the GDB console).

These runs could help to find out the problem.

P.S. I was using debug configuration with the full path to GDB (I had
few different versions installed) and did not find any problems with
it. So, it should work...

Dmitry

2008/11/18 Dylan Reynolds <dylan.reynolds@xxxxxxxxxxxxxx>:
  
First of all apologies for including these old posts in this post.  I could
not figure out how to reply to the old posts and I thought they were
important because they related to my new post.

I am having the same problem as Pranay,

I already had Cygwin installed - it has the latest 6.8.2 gdb installed.  I
am yet to try and debug from the Cygwin command line.  I will try that
shortly.  I get the same msg as Pranay pasted above.

Hence, in Eclipse I altered the settings for the debugger for the Hello
World exe.  I changed the debugger from simplt gdb, to the full path
C:\cygwin\bin\gdb.exe.  I have no idea what gdb on its own would refer to -
i am using the Cygwin toolchain so perhaps it simply executes gdb using this
toolchain.

The result of specifying the path to the debugger is totally different but
still ends with an error.  Now I get this in my console (HW Test Again is
the project name - the rest is simply the c++ hello world app that you can
automatically open with Eclipse new project wizard):

Warning: /Users/Entecho/Desktop/Programming/EclipseWorkspace/HW Test
Again/Debug/src;C: No such file or directory.
Warning: /Users/Entecho/Desktop/Programming/EclipseWorkspace/HW Test
Again/Debug;C: No such file or directory.
Warning: /Users/Entecho/Desktop/Programming/EclipseWorkspace/HW Test
Again;C: No such file or directory.
Warning: /cygdrive/c/Users/Entecho/Desktop/Programming/EclipseWorkspace/HW
Test Again/C: No such file or directory.
No source file named HelloWorldTest.cpp.
gdb: unknown target exception 0xc0000135 at 0x773e9cac
You can't do that without a process to debug.
kill
The program is not being run.

Furthermore, the error msg says:

Execution is suspended because of error.
 You can't do that without a process to debug.


Now I realise that this could be because using the path is totally the wrong
thing to do - please advise me if this is the case.  With the MinGW gdb it
is specified using the path so I thought that perhaps this would work.

At the moment I still can't debug with the current Ganymede Eclipse and the
current Cygwin - whether using the default setting: gdb or using the path
(as explained above): C:\cygwin\bin\gdb.exe

Any help with this would be greatly appreaciated.

Kind Regards

Dylan Reynolds
    
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
  


Back to the top