News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

How do I use the mingw64 gdb debugger?

Started by lucky7456969, April 06, 2014, 06:41:51 AM

Previous topic - Next topic

lucky7456969

Hello,
I wonder how do I use the mingw64 gdb debugger instead of the
mingw32 provided by the codeblocks package.

I start up a debuggee, and it goes away immediately. I point to the C:\mingw64\bin\gdb.exe in the debugger
setting menu. The program runs fine, but I just can't make it stop at the breakpoints.
Thanks
Jack


[debug]Starting program: 
[debug]>>>>>>cb_gdb:

Starting the debuggee failed: No executable specified, use `target exec'.


oBFusCATed

Do you have a project?
And post the full log from the debugger please.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

lucky7456969

Where can I find such files? I have enable full logging,
but there isn't any .log file existed in my project folder.
Thanks
Jack

oBFusCATed

Log and Others -> Debugger -> Right click -> Copy to clipboard
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

lucky7456969

Thanks for helping!
Jack


Build started on: 07-04-2014 at 03:30.44
Build ended on: 07-04-2014 at 03:30.47

-------------- Build: Debug in PerfectSim (compiler: mingw64 - nonunicode)---------------
x86_64-w64-mingw32-g++.exe -Wall -g -g -Wall -g -IE:\Software\Q\qt-4.7.4\4.7.4-qt-x64\include -IE:\Software\Q\qt-4.7.4\4.7.4-qt-x64\include\QtGui -c "E:\Jacky\Documents\Code Blocks Projects\PerfectSim\Camera\Camera.cpp" -o obj\Debug\Camera\Camera.o
x86_64-w64-mingw32-g++.exe -Wall -g -g -Wall -g -IE:\Software\Q\qt-4.7.4\4.7.4-qt-x64\include -IE:\Software\Q\qt-4.7.4\4.7.4-qt-x64\include\QtGui -c "E:\Jacky\Documents\Code Blocks Projects\PerfectSim\main.cpp" -o obj\Debug\main.o
x86_64-w64-mingw32-g++.exe -Wall -g -g -Wall -g -IE:\Software\Q\qt-4.7.4\4.7.4-qt-x64\include -IE:\Software\Q\qt-4.7.4\4.7.4-qt-x64\include\QtGui -c "E:\Jacky\Documents\Code Blocks Projects\PerfectSim\OpenGLWidget.cpp" -o obj\Debug\OpenGLWidget.o
x86_64-w64-mingw32-g++.exe -LE:\Software\Q\qt-4.7.4\4.7.4-qt-x64\lib -o bin\Debug\PerfectSim.exe obj\Debug\Camera\Camera.o obj\Debug\main.o obj\Debug\OpenGLWidget.o -lQtCore4 -lQtGui4 "C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x64\d3dx9d.lib" E:\Software\Q\qt-4.7.4\4.7.4-qt-x64\lib\libQtCored4.a E:\Software\Q\qt-4.7.4\4.7.4-qt-x64\lib\libQtGuid4.a E:\Software\Q\qt-4.7.4\4.7.4-qt-x64\lib\libQtHelpd4.a E:\Software\Q\qt-4.7.4\4.7.4-qt-x64\lib\libqtmaind.a D:\mingw64\x86_64-w64-mingw32\lib\libuser32.a D:\mingw64\x86_64-w64-mingw32\lib\libkernel32.a D:\mingw64\x86_64-w64-mingw32\lib\libgdi32.a D:\mingw64\x86_64-w64-mingw32\lib\libgdiplus.a D:\mingw64\x86_64-w64-mingw32\lib\libd3dx9.a -mwindows
Output file is bin\Debug\PerfectSim.exe with size 549.12 KB
Process terminated with status 0 (0 minute(s), 2 second(s))
0 error(s), 0 warning(s) (0 minute(s), 2 second(s))

BlueHazzard

this is the build log, not the debugger log

you have to start the debugger and then copy the text from the debugger tab  from the bottom of the window

lucky7456969


[debug]Command-line: C:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname  -quiet  -args E:/Jacky/DOCUME~1/CODEBL~1/PERFEC~1/bin/Debug/PERFEC~1.EXE
[debug]Working dir : E:\Jacky\DOCUME~1\CODEBL~1\PERFEC~1

Starting debugger: C:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname  -quiet  -args E:/Jacky/DOCUME~1/CODEBL~1/PERFEC~1/bin/Debug/PERFEC~1.EXE
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]"E:/Jacky/DOCUME~1/CODEBL~1/PERFEC~1/bin/Debug/PERFEC~1.EXE": not in executable format: File format not recognized
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.6.1
[debug]Copyright (C) 2013 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.6.1

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]No symbol table is loaded.  Use the "file" command.
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source C:\Program Files (x86)\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory D:/mingw64/bin
[debug]Source directories searched: D:/mingw64/bin;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> directory E:/Jacky/DOCUME~1/CODEBL~1/PERFEC~1/
[debug]Source directories searched: E:/Jacky/DOCUME~1/CODEBL~1/PERFEC~1;D:/mingw64/bin;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "E:/Jacky/Documents/Code Blocks Projects/PerfectSim/main.cpp:7"
[debug]No symbol table is loaded.  Use the "file" command.
[debug]Breakpoint 2 ("E:/Jacky/Documents/Code Blocks Projects/PerfectSim/main.cpp:7") pending.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]No executable specified, use `target exec'.
[debug]Starting program: 
[debug]>>>>>>cb_gdb:

Starting the debuggee failed: No executable specified, use `target exec'.

[debug]> quit

Debugger finished with status 0

lucky7456969

I discovered the cause, due to wrong debugger setting, should be using X:\mingw64\bin\gdb.exe
However, I wonder can I designate different debuggers to different compilers?
Thanks
Jack

oBFusCATed

Yes, you can.

Steps:
1. Make two or more configs
2. In the toolchain settings of the compiler choose the proper config for every compiler
3. Select Debug-> Active debugger -> Target's default
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]