Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Eclipse Luna, CDT, gdb issues with breakpoints(GDB terminates with -1 and skips all breakpoints)
Eclipse Luna, CDT, gdb issues with breakpoints [message #1439938] Tue, 07 October 2014 18:14 Go to next message
chadd williams is currently offline chadd williamsFriend
Messages: 3
Registered: October 2014
Junior Member
Most of the time, but not always, when I debug a C program gdb
produces an exit value of -1 and the execution does not stop at
any breakpoints. The execution also does not stop at the first line of main().

I have not yet discerned any pattern as to when the breakpoints work
and when they do not work.

Further, if I revert back to Eclipse Kepler, allow Kepler to
"update" the workspace, breakpoints work fine in Kepler.

I downloaded the Eclipse IDE for C/C++ Developers x86_64. The only plugins
I installed are subclipse and pydev.

OpenSUSE 13.1 x86_64

Eclipse Luna Version: Luna Release (4.4.0)
Build id: 20140612-0600

CDT: Version: 8.4.0.201406111759

gdb --version
GNU gdb (GDB; openSUSE 13.1) 7.6.50.20130731-cvs

gcc --version
gcc (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388]

java -version
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)



What I see:

The Debug panel of the Debug Perspective says:

GameOfLife [C/C++ Application]	
	<terminated, exit value: -1>gdb	



The Console:

gdb traces ends with:
883,979 =breakpoint-modified,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x00000\
0000040154e",func="main",file="GameOfLife.c",fullname="/home/chadd/workspace/GameOfLife/GameOfLife.c\
",line="228",thread-groups=["i1"],times="1",original-location="main"}
883,981 *stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x000000000040154e",func\
="main",args=[{name="argc",value="1"},{name="argv",value="0x7fffffffdcf8"}],file="GameOfLife.c",full\
name="/home/chadd/workspace/GameOfLife/GameOfLife.c",line="228"},thread-id="1",stopped-threads="all"\
,core="1"
883,981 =breakpoint-deleted,id="1"
883,981 (gdb)
Re: Eclipse Luna, CDT, gdb issues with breakpoints [message #1440510 is a reply to message #1439938] Wed, 08 October 2014 13:01 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
The gdb traces seem correct. The breakpoint is deleted because it was the temporary one on 'main'. The *stopped event shows that GDB did stop at main. What happens after that? Does the entire session die? Do you see any other gdb traces? Is GDB crashing?

Marc
Re: Eclipse Luna, CDT, gdb issues with breakpoints [message #1440614 is a reply to message #1440510] Wed, 08 October 2014 15:53 Go to previous messageGo to next message
chadd williams is currently offline chadd williamsFriend
Messages: 3
Registered: October 2014
Junior Member

I think GDB is crashing.

In the Debug Panel I see that gdb returned an exit value of -1. The =breakpoint-deleted is the last thing in gdb traces. The executable continues to run (to be listed in top), however, I think it is paused at the breakpoint. GDB, however, is no longer running.
Re: Eclipse Luna, CDT, gdb issues with breakpoints [message #1440733 is a reply to message #1440614] Wed, 08 October 2014 19:51 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
Ok so the next step is to upgrade to a newer GDB and see if the problem still happens. GDB 7.8 is available.
If the problem still happens (or you are not in the possibility of upgrading), you will want to figure out what is making GDB crash.
To do that you should save the 'gdb traces' and extract the commands sent to GDB. Then try them by hand in a command-line GDB.
To start a GDB that accepts MI commands start it like this:
> gdb -i mi --nx

Then gradually paste the commands used by eclipse and see if you can reproduce the crash. You should be able to.
After that you try again and again while removing configuration commands (the commands sent early in the session).
The hope is that you figure out something that can show a workaround. For example, you could find out that the
crash does not happen when you remove the non-stop option, in which case you can tell eclipse to do the same.

Once well isolated with the latest GDB, you can choose to open a bug with the GDB community detailing how to reproduce the problem.

I hope this helps

Marc
Re: Eclipse Luna, CDT, gdb issues with breakpoints [message #1440742 is a reply to message #1440733] Wed, 08 October 2014 20:10 Go to previous message
chadd williams is currently offline chadd williamsFriend
Messages: 3
Registered: October 2014
Junior Member
Marc:

Thanks for your help. I have upgraded to GDB 7.8 and see how it performs for the next few days.

Previous Topic:arm-linux cross compile under Ubuntu fails helloworld.cpp
Next Topic:Unable to configure Arduino to work with Eclipse Juno
Goto Forum:
  


Current Time: Sat Dec 21 15:55:05 GMT 2024

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

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

Back to the top