Debug - gdb.exe crashes (only when using CodeLite)

General questions regarding the usage of CodeLite
Meiner
CodeLite Curious
Posts: 6
Joined: Mon Jul 07, 2014 1:15 am
Genuine User: Yes
IDE Question: c++
Contact:

Debug - gdb.exe crashes (only when using CodeLite)

Post by Meiner »

Hi,

I'm trying to debug a program with the gdb of MinGW. When I start debugging (after a full rebuild) I get a gdb.exe window, but then the gdb.exe crashes immediately (before any other action happens). My only change was to set the path to the gdb.exe in the debugger settings. When I try the same debugger e.g. in CodeBlocks everything works fine for the same project. What can be the reason for that?

Only error message I found was in the trace window:

Code: Select all

Warning: Resource files must have same version number.
Error: can't open file '...\.codelite\compilation.db.txt'
Meiner
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Debug - gdb.exe crashes (only when using CodeLite)

Post by eranif »

Meiner wrote: CODE: SELECT ALL
Warning: Resource files must have same version number.
Error: can't open file '...\.codelite\compilation.db.txt'
Not relevant
Meiner wrote:CodeBlocks everything works fine for the same project
CodeLite and CodeBlocks are _not_ using the same code base, CodeLite uses the more advanced API of GDB (google: "gdb MI") while CodeBlocks does not.

You should probably upgrade your GDB and the problem will be solved.
Also, please make sure you read the HOW TO POST thread and post some more relevant information (see my signature or search the forum for HOW TO POST)

Eran
Make sure you have read the HOW TO POST thread
Meiner
CodeLite Curious
Posts: 6
Joined: Mon Jul 07, 2014 1:15 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Debug - gdb.exe crashes (only when using CodeLite)

Post by Meiner »

eranif wrote: CodeLite and CodeBlocks are _not_ using the same code base, CodeLite uses the more advanced API of GDB (google: "gdb MI") while CodeBlocks does not.

You should probably upgrade your GDB and the problem will be solved.
Also, please make sure you read the HOW TO POST thread and post some more relevant information (see my signature or search the forum for HOW TO POST)

Eran
Thanks for your response.
Currently I'm using gdb version 7.6.1-1, which is the newest gdb MinGW (and also mingw-builds) offers. Is gdb 7.7 required to run debugging in Codelite?
I tried also the python enabled gdb in version 7.5-1, which does not have the problem with the crash, but therefore the debugger pane in Codelite closes immediately (no start of debugging, breakpoints set).

EDIT: Tried it with gdb 7.7 from mingw-w64, but there is the same problem.
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Debug - gdb.exe crashes (only when using CodeLite)

Post by eranif »

Meiner wrote:Is gdb 7.7 required to run debugging in Codelite?
No, there are no requirements for gdb version. They are all working just fine with codelite.
Meiner wrote:I tried also the python enabled gdb in version 7.5-1, which does not have the problem with the crash, but therefore the debugger pane in Codelite closes immediately (no start of debugging, breakpoints set).
You don't provide enough information - so I can't help you here.

Read and follow the guides in the HOW TO POST thread (its in my signature, or run a forum search)

Eran
Make sure you have read the HOW TO POST thread
Meiner
CodeLite Curious
Posts: 6
Joined: Mon Jul 07, 2014 1:15 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Debug - gdb.exe crashes (only when using CodeLite)

Post by Meiner »

Ok I try it once again:

OS: Windows 7
CodeLite: 6.0 (not self compiled)
Compiler: gcc/g++ 4.8.1 (MinGW version)
GDB: Tried 7.5-1 (MinGW version), 7.6.1-1 (MinGW version), 7.7 (Mingw-w64 version)

I'm doing a normal debug build with

Code: Select all

-g;-O0;-Wall;-std=c++11;$(shell pkg-config --cflags gtkmm-3.0 gdal)
. No changes of the debugger standard settings except the path to gdb (global, no project specific configurations). Because debugging do not start I have no debugger log.

To make sure to give all information that could be relevant, here is my build output:

Code: Select all

C:\Windows\system32\cmd.exe /c "D:/Programmierung/Compiler/MinGW/bin/mingw32-make.exe -j4 -e -f  Makefile"
"----------Building project:[ MovingMap - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'D:/Programmierung/Projektdateien/Privat/CPP/MovingMap'
D:\Programmierung\Compiler\MinGW\bin\g++.exe  -o ./Debug/MovingMap @"MovingMap.txt" -L.   -LD:/Programmierung/Bibliotheken/GDAL/mingw_build_1_11/lib -LD:/Programmierung/Bibliotheken/GUI/GTK/gtkmm3/lib -LD:/Programmierung/Bibliotheken/GUI/GTK/gtk+-3.6.4/lib -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lglibmm-2.4 -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lpangocairo-1.0 -lpangoft2-1.0 -lfreetype -lfontconfig -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lm -latk-1.0 -lcairo-gobject -lgio-2.0 -lcairomm-1.0 -lcairo -lsigc-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lgdal
mingw32-make.exe[1]: Leaving directory 'D:/Programmierung/Projektdateien/Privat/CPP/MovingMap'
0 errors, 0 warnings
Is there more information you need?
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Debug - gdb.exe crashes (only when using CodeLite)

Post by eranif »

The debugger log:
Enable debugger logging and start debug session again

If the debug perspectives closes immediately, you can "restore" it from the Perspective menu:
Perspective->Debug.layout

Eran
Make sure you have read the HOW TO POST thread
Meiner
CodeLite Curious
Posts: 6
Joined: Mon Jul 07, 2014 1:15 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Debug - gdb.exe crashes (only when using CodeLite)

Post by Meiner »

Ah ok I did not know that. But I have to admit that I found out what the problem was (sorry for wasting your time):

I have to deactivate the option "Break when C++ exception is thrown" (I think I activated that option inadvertently). Because I'm also using Codeblocks I remember a time, when the similiar option "Catch C++ exceptions" triggers the same error (crash of gdb.exe, sometimes of gdborig.exe). Is that a reproducible problem and is that something related to gdb or CodeLite?

The debug log with activated option is attached (too large to post it here with code tags).

Meiner
You do not have the required permissions to view the files attached to this post.
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Debug - gdb.exe crashes (only when using CodeLite)

Post by eranif »

Meiner wrote:Ah ok I did not know that. But I have to admit that I found out what the problem was (sorry for wasting your time):
No harm done. When you are enabling the option 'break when C++ exception is thrown' codelite is simply running this command:

Code: Select all

catch throw
Indeed, I too noticed that this tends to make gdb unstable.
Providing the debug log in the first time, would have help me figure that one out faster :/

Eran
Make sure you have read the HOW TO POST thread
Post Reply