Hello, i'm having problems with my debugger. even with a fresh install the debugger fails to highlight the breakpoints. it does stop at breakpoints, only without any information about the line number or source file.
Using Codeblocks 20.03, compĂling with -g.
even using the default console app right after a fresh install, with a breakpoint on line 7:
cout << "Hello world!" << endl;
gives me this output:
[debug]Starting program: C:\codeblocks\prj\work\bin\Debug\work.exe
Child process PID: 2848
[debug][New Thread 2848.0x2484]
[debug][New Thread 2848.0x2b98]
[debug]Thread 1 received signal ?, Unknown signal.
[debug]0x0009df38 in ?? ()
[debug]>>>>>>cb_gdb:
In ?? () ()
[debug]> bt 30
[debug]#0 0x0009df38 in ?? ()
[debug]#1 0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:
I suspected it could have something to do with permissions, but i tried a couple of different users, in different project folders, and changed ownership of files.
been looking around online for some time now but found nothing.
thanks for replying!
rebuild log:
-------------- Build: Debug in example (compiler: GNU GCC Compiler)---------------
g++.exe -Wall -fexceptions -g -c C:\codeblocks\prj\example\main.cpp -o obj\Debug\main.o
g++.exe -o bin\Debug\example.exe obj\Debug\main.o
Output file is bin\Debug\example.exe with size 1.50 MB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
gdb and g++ are (default after install) both 64bit.
It seems however that my program is 32bit
I cannot compile with the -m64 flag:
C:\codeblocks\prj\example\main.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in
is this the problem? mingw64 not included in codeblocks installer?
alright, here is full debug log:
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\codeblocks\prj\work\
Adding source dir: C:\codeblocks\prj\work\
Adding source dir: C:\codeblocks\prj\example\
Adding source dir: C:\codeblocks\prj\example\
Adding file: C:\codeblocks\prj\example\bin\Debug\example.exe
Changing directory to: C:/codeblocks/prj/example/.
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Common Files\Propellerhead Software\ReWire;C:\Program Files\Common Files\Propellerhead Software\ReWire;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Users\alex\AppData\Local\Microsoft\WindowsApps
[debug]Command-line: C:\codeblocks\MinGW\bin\gdb.exe -nx -fullname -quiet -args C:/codeblocks/prj/example/bin/Debug/example.exe
[debug]Working dir : C:\codeblocks\prj\example
Starting debugger: C:\codeblocks\MinGW\bin\gdb.exe -nx -fullname -quiet -args C:/codeblocks/prj/example/bin/Debug/example.exe
done
[debug]> set prompt >>>>>>cb_gdb:
Setting breakpoints
[debug]Reading symbols from C:/codeblocks/prj/example/bin/Debug/example.exe...
[debug]done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 8.1
[debug]Copyright (C) 2018 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 "x86_64-w64-mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 8.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 200
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory C:/codeblocks/prj/work/
[debug]Source directories searched: C:/codeblocks/prj/work;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> directory C:/codeblocks/prj/example/
[debug]Source directories searched: C:/codeblocks/prj/example;C:/codeblocks/prj/work;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: C:\codeblocks\prj\example\bin\Debug\example.exe
Child process PID: 11844
[debug][New Thread 11844.0x2cf8]
[debug][New Thread 11844.0x3708]
[debug][Thread 11844.0x3708 exited with code 0]
[debug][Inferior 1 (process 11844) exited normally]
[debug]>>>>>>cb_gdb:
[Inferior 1 (process 11844) exited normally]
[debug]> quit
Debugger finished with status 0
oh sorry:
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\codeblocks\prj\work\
Adding source dir: C:\codeblocks\prj\work\
Adding source dir: C:\codeblocks\prj\example\
Adding source dir: C:\codeblocks\prj\example\
Adding file: C:\codeblocks\prj\example\bin\Debug\example.exe
Changing directory to: C:/codeblocks/prj/example/.
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Common Files\Propellerhead Software\ReWire;C:\Program Files\Common Files\Propellerhead Software\ReWire;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Users\alex\AppData\Local\Microsoft\WindowsApps
[debug]Command-line: C:\codeblocks\MinGW\bin\gdb.exe -nx -fullname -quiet -args C:/codeblocks/prj/example/bin/Debug/example.exe
[debug]Working dir : C:\codeblocks\prj\example
Starting debugger: C:\codeblocks\MinGW\bin\gdb.exe -nx -fullname -quiet -args C:/codeblocks/prj/example/bin/Debug/example.exe
done
[debug]Reading symbols from C:/codeblocks/prj/example/bin/Debug/example.exe...
[debug]done.
[debug](gdb)
[debug]> set prompt >>>>>>cb_gdb:
Setting breakpoints
[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 8.1
[debug]Copyright (C) 2018 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 "x86_64-w64-mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 8.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 200
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory C:/codeblocks/prj/work/
[debug]Source directories searched: C:/codeblocks/prj/work;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> directory C:/codeblocks/prj/example/
[debug]Source directories searched: C:/codeblocks/prj/example;C:/codeblocks/prj/work;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "C:/codeblocks/prj/example/main.cpp:7"
[debug]Breakpoint 2 at 0x401366: file C:\codeblocks\prj\example\main.cpp, line 7.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: C:\codeblocks\prj\example\bin\Debug\example.exe
Child process PID: 2768
[debug][New Thread 2768.0x3088]
[debug][New Thread 2768.0x1d20]
[debug]Thread 1 received signal ?, Unknown signal.
[debug]0x0009df38 in ?? ()
[debug]>>>>>>cb_gdb:
In ?? () ()
[debug]> bt 30
[debug]#0 0x0009df38 in ?? ()
[debug]#1 0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:
Continuing...
[debug]> cont
[debug]Continuing.
[debug][Thread 2768.0x1d20 exited with code 1073741855]
[debug][Inferior 1 (process 2768) exited with code 010000000037]
[debug]>>>>>>cb_gdb:
[Inferior 1 (process 2768) exited with code 010000000037]
[debug]> quit
Debugger finished with status 0
Hmmm.... all i can find have two root causes:
1) Bug in GDB (I know that version 8.1 is buggy as hell, i use 8.3 )
2) Bitness of executable and gdb do not match...
I do not understand how 2) can happen in an compiler installation with codeblocks... We never had this problem before and quite some people use GDB+ Codeblocks with the standard installation. It should compile to 64 bit without the -m64 bit flag... The same is for 1)...
Have you installed your own compiler?
maybe someone else can help you here...
You can try to update gdb to 8.3 and newer and/or you can try to use the same bitness for everything...
You can also try to install your own compiler: http://mingw-w64.org/doku.php/download/mingw-builds
[debug]Thread 1 received signal ?, Unknown signal.
i really think this has to do with bitness.. gdb should know the break signal for a breakpoint...
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Common Files\Propellerhead Software\ReWire;C:\Program Files\Common Files\Propellerhead Software\ReWire;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Users\alex\AppData\Local\Microsoft\WindowsApps
FYI: Based on the above line you was using the 32 bit MinGW installed with the 32 bit Code::Blocks.
That was why you had issues doing an 64 bit build/debug.
In the future for this type of problems, make sure you have at most one mingw GCC compiler in the PATH!
Edit: And, make sure the toolchain settings is pointing to the correct MinGW GCC compiler.
Tim S.
Set variable: PATH=.;C:\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin;C:\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Common Files\Propellerhead Software\ReWire;C:\Program Files\Common Files\Propellerhead Software\ReWire;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Users\alex\AppData\Local\Microsoft\WindowsApps
do you mean this list is for searching for toolchain execs?
because in settings->compiler->toolchain execs->compilers install dir was set to my 20.03 version (c:\codeblocks\mingw) until i changed it to mingw-w64.