Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Debugging not possible in Eclipse
Debugging not possible in Eclipse [message #656779] Mon, 28 February 2011 15:00 Go to next message
hefeweizen  is currently offline hefeweizen Friend
Messages: 32
Registered: July 2009
Member
Hi, I tried to debug a C++ project in Eclipse Helios, last release. I set breakpoints in some non-main functions, but the debug function never stops there, and I get a warning message which says

"breakpoint attribute problem installation failed"

What could be the reason?

PS: The same problem also happens with Eclipse Galileo, last release
PS2: This bug is described below, but no solution:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=331833
Re: Debugging not possible in Eclipse [message #657041 is a reply to message #656779] Tue, 01 March 2011 12:32 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1968
Registered: July 2009
Senior Member
We need more information to help you.
Which OS?
Which gdb version?
When you activate the gdb traces (see Preferences_>C/C++->Debug) what is the output? You should see a command that sets the breakpoint. Is there an error message from gdb?
Do you debug an executable or a shared lib/DLL?


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Debugging not possible in Eclipse [message #657142 is a reply to message #657041] Tue, 01 March 2011 17:44 Go to previous messageGo to next message
hefeweizen  is currently offline hefeweizen Friend
Messages: 32
Registered: July 2009
Member
OS = Mac OS X Leopard 10.5.8
gdb version available is:
GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)

When I activate traces I can see the following:
a) in the main function, I can put breakpoints, and the message is something like

499-break-insert /Users/XXXX.cpp:46
499^done,bkpt={number="12",type="breakpoint",disp="keep ",enabled="y",addr="0x00005649",func="main",file="../src/dogrid.cpp ",line="46",shlib="/Users/YYYY/Eclipse_exe",times="0"},time={wallclock= "0.00342",user="0.00082",system="0.00177",start="1299001190.946541 ",end="1299001190.949965"}
(gdb)

where XXXX and YYYY are very similar paths (omitted)

b) if I try to put a breakpoint in a non-main function which is in another file than main, I get errors on the interface and the message on the output is:

503-break-insert /Users/ZZZZ.cpp:63
503^done,matches={b={index="0",canonical="/Users/AAAA.cpp:63 ",file="../src/grid.cpp",binary="/Users/BBBB/Eclipse_exe",line= "63",addr="0x00006e53"},b={index="1",canonical="/Users/CCCC.cpp:63 ",file="../src/grid.cpp",binary="/Users/DDDD/Debug/Eclipse_exe ",line="63",addr="0x000070fd"}},time={wallclock="0.00305 ",user="0.00108",system="0.00197",start="1299001310.803738 ",end="1299001310.806785"}
(gdb)



I am not debuggin neither shared lib nor a DLL. Just a standalone executable. I started from the Hello World example that comes with eclipse. I deleted the hello.cpp that was there and then I added my own code. I know it was a dirty solution, but the program compiles and a new makefile is generated.
Re: Debugging not possible in Eclipse [message #657203 is a reply to message #657142] Tue, 01 March 2011 22:39 Go to previous messageGo to next message
hefeweizen  is currently offline hefeweizen Friend
Messages: 32
Registered: July 2009
Member
UPDATE:

In the same conditions, I installed Ubuntu 9.10 in a virtual machine under parallels 5.0. The I installed Eclipse CDT Helios and did the same procedure. Now I do not get this error. My conclusion at this point is, either gdb from mac is fault suspicious or eclipse for mac has problems in this aspect.

As a workaround I am thinking about working in Eclipse for mac and setting up remote debugging so the compilation and gdbsrver run on the virtual linux machine, at least until somebody proposes a better solution.
Re: Debugging not possible in Eclipse [message #657283 is a reply to message #657203] Wed, 02 March 2011 10:32 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1968
Registered: July 2009
Senior Member
The gdb version you are using is very outdatted. AFAIK, the latest version for Mac is 6.8 (Which is also very old because Linux and Windows have already gdb 7.2. However, Apple does not update their gdb version.). You should try to get at least gdb 6.8

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Debugging not possible in Eclipse [message #657299 is a reply to message #657283] Wed, 02 March 2011 11:13 Go to previous messageGo to next message
hefeweizen  is currently offline hefeweizen Friend
Messages: 32
Registered: July 2009
Member
I got gdb 7.2 source and compiled it for mac. In Eclipse, debugging preferences, I changed the executable location to the new one, although I do not know where teh new .gdbinit should be, any hints? Anyway I sitll get the same error, exactly the same. I feel that I did not tell eclipse correctly how to use the new compiled gdb, is it another place where I should specify this?

P.S. I am using standard process launcher, should I change to DSF/GDB?
Re: Debugging not possible in Eclipse [message #657533 is a reply to message #657299] Thu, 03 March 2011 08:33 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1968
Registered: July 2009
Senior Member
Eclipse uses gdb which is found first in the path.I would recommend using DSF/GDB.

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Debugging not possible in Eclipse [message #657537 is a reply to message #657533] Thu, 03 March 2011 08:48 Go to previous messageGo to next message
hefeweizen  is currently offline hefeweizen Friend
Messages: 32
Registered: July 2009
Member
Ok, I select DSF/GDB and point to the new compiled 7.2 gdb. Now I get the following error message:

Error in final launch sequence
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Unable to find Mach task port for process-id 72921: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(Cool)
Unable to find Mach task port for process-id 72921: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(Cool)

Does it mean that:
a) I am still pointing to a wrong gdb (although last version)?
b) I should point to the "internal" eclipse gdb?

Thanks
Re: Debugging not possible in Eclipse [message #657538 is a reply to message #657299] Thu, 03 March 2011 08:51 Go to previous messageGo to next message
hefeweizen  is currently offline hefeweizen Friend
Messages: 32
Registered: July 2009
Member
similar problem here:

http://stackoverflow.com/questions/1270285/trouble-debugging -c-using-eclipse-galileo-on-mac

Re: Debugging not possible in Eclipse [message #657594 is a reply to message #657538] Thu, 03 March 2011 12:07 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1968
Registered: July 2009
Senior Member
I think you must use the gdb version supported by Apple (6.Cool. AFAIK, they added some specialities to the FSF gdb.

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Debugging not possible in Eclipse [message #657603 is a reply to message #657594] Thu, 03 March 2011 13:02 Go to previous messageGo to next message
hefeweizen  is currently offline hefeweizen Friend
Messages: 32
Registered: July 2009
Member
this is the one I used, and the one that gives all the initial problems, that's why i am here asking for support
Re: Debugging not possible in Eclipse [message #657751 is a reply to message #657603] Thu, 03 March 2011 20:28 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1968
Registered: July 2009
Senior Member
hefeweizen wrote on Thu, 03 March 2011 14:02
this is the one I used, and the one that gives all the initial problems, that's why i am here asking for support

I meant gdb 6.8 (unfortunately, my last message was not readable).
With respect to your problem with gdb 7.2 see last message here http://discussions.apple.com/thread.jspa?threadID=1970342 and the mentioned workaround here
http://sourceware.org/gdb/wiki/BuildingOnDarwin


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Debugging not possible in Eclipse [message #657916 is a reply to message #657751] Fri, 04 March 2011 15:23 Go to previous message
hefeweizen  is currently offline hefeweizen Friend
Messages: 32
Registered: July 2009
Member
I find no way to get gdb 6.8 right now. I tried to use

/opt/local/bin/fsf-gdb

which is version 7.1

and now it seems to work!

Using standard process launcher (not DSF/GDB)

For the moment, I will continue testing it and reporting

thanks

P.D. How could I get gdb 6.8, just in case?
Previous Topic:conditional compilation ignored
Next Topic:which property to modify for finding include files?
Goto Forum:
  


Current Time: Thu Nov 27 12:12:40 GMT 2014

Powered by FUDForum. Page generated in 0.02371 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software