Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » <terminated, exit value: -1>gdb(CDT crashing gdb)
<terminated, exit value: -1>gdb [message #807605] Sun, 26 February 2012 19:18 Go to next message
Angus Henderson is currently offline Angus HendersonFriend
Messages: 13
Registered: October 2011
Junior Member

I have a rather complex OpenGL, fltk, gdal, multi threaded c++ app. Which crashes gdb when I break in the OpenGL thread and then continue. I can switch to command line gdb and debug without problems but that is so painfully slow in comparison to eclipse.

Do I need to get a simple app that had a similar problem to proceed from here. Or does anyone have any good advice...

Angus
Re: <terminated, exit value: -1>gdb [message #808037 is a reply to message #807605] Mon, 27 February 2012 10:11 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1967
Registered: July 2009
Senior Member
Which gdb and Eclipse version are you using?

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: <terminated, exit value: -1>gdb [message #808189 is a reply to message #808037] Mon, 27 February 2012 14:17 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 285
Registered: July 2009
Senior Member
If GDB crashed, it may be a good idea to find out what the problem with GDB is.
You can try to reproduce the crash outside of Eclipse. As you say, doing the debugging manually does not cause the crash. However, if you reproduced the exact steps Eclipse does, it should happen. You can see exactly what commands Eclipse sends to GDB in the 'gdb traces' console:
http://wiki.eclipse.org/CDT/User/FAQ#I.27ve_been_asked_for_.27gdb_traces.27.2C_where_can_I_find_them.3F

Start GDB manually like this:
<gdbPath> -interpreter mi -nx

Then copy/paste the commands one by one, and reproduce the crash. After that, I normally trip the set of commands until I find a small sequence that causes the crash. Then you can report it to the GDB community.

Marc
Re: <terminated, exit value: -1>gdb [message #810710 is a reply to message #808037] Thu, 01 March 2012 13:09 Go to previous messageGo to next message
Angus Henderson is currently offline Angus HendersonFriend
Messages: 13
Registered: October 2011
Junior Member

Version: Indigo service relese 2
Eclipse build id 20120216-1857

GDB 7.1-ubuntu
Re: <terminated, exit value: -1>gdb [message #810712 is a reply to message #808189] Thu, 01 March 2012 13:13 Go to previous messageGo to next message
Angus Henderson is currently offline Angus HendersonFriend
Messages: 13
Registered: October 2011
Junior Member

i attempted what you said, but there are dozens of gdb commands to cut & paste, and i could not get the multi-line ones to execute properly.

i will keep trying.

also i am not clear on how eclipse sets a breakpoint while the app is running, does it break execution and continue automatically?
Re: <terminated, exit value: -1>gdb [message #810723 is a reply to message #810712] Thu, 01 March 2012 13:29 Go to previous messageGo to next message
Angus Henderson is currently offline Angus HendersonFriend
Messages: 13
Registered: October 2011
Junior Member

i got a bit further, if i cut and paste the multi-line cmds into gedit and edit it back to a single line cmd it works, but when i get to "13-exec-run" my app terminates saying /dev/pts/1: No such file or directory - the previous gdb cmd was "12-inferior-tty-set /dev/pts/1"

interestingly, when eclipse loses contact with my app - there is a long pause - then after the terminated -1 message in the Debug/call stack pane, the app is left running, then if i try and load a file or interact with the app in any way it will shut down.
Re: <terminated, exit value: -1>gdb [message #810729 is a reply to message #810723] Thu, 01 March 2012 13:35 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 285
Registered: July 2009
Senior Member
Sorry, you should skip the "12-inferior-tty-set /dev/pts/1".
/dev/pts/1 was created by eclipse, so when you copy/paste it again, it won't exist.
Just skip that command and see if you can see what else makes it fail.

Marc
Re: <terminated, exit value: -1>gdb [message #810730 is a reply to message #810729] Thu, 01 March 2012 13:36 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 285
Registered: July 2009
Senior Member
> also i am not clear on how eclipse sets a breakpoint while the app is running, does it break execution and continue automatically?

Yes, that is right.
Re: <terminated, exit value: -1>gdb [message #843315 is a reply to message #810730] Fri, 13 April 2012 00:10 Go to previous message
Angus Henderson is currently offline Angus HendersonFriend
Messages: 13
Registered: October 2011
Junior Member

Here is another fact on this issue:

I can set breakpoints anywhere in my code EXCEPT inside the ::draw() method.

This method is called from a base class in the fltk-1.3.0 library, the whole class inherits from an Fl_Gl_Window.

eclipse or gdb cannot display the call stack before the ::draw(), and any attempt to step or continue results in gdb terminating.

[Updated on: Fri, 13 April 2012 00:59]

Report message to a moderator

Previous Topic:installed CDT successfully´╝îbut no C++project in new
Next Topic:[SOLVED] "Unresolved inclusion: <stdio.h>" in C project!!
Goto Forum:
  


Current Time: Sun Nov 23 17:33:23 GMT 2014

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

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