User forums > Help

gdb doesn't link to source

(1/4) > >>

sydnytt:
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:

--- Code: ---cout << "Hello world!" << endl;
--- End code ---

gives me this output:

--- Code: ---[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:
--- End code ---

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.

BlueHazzard:
Are you sure you are compiling and running the debug version of your project?
What is in the build log if you make a rebuild? Is the -g present?

Are your compiler and debugger compatible? the right version?
Does the compiler, debugger and your program have the same bit version (all 64bit, or all 32bit)?

sydnytt:
thanks for replying!

rebuild log:

--- Code: ----------------- 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))

--- End code ---

gdb and g++ are (default after install) both 64bit.

It seems however that my program is 32bit
I cannot compile with the -m64 flag:

--- Code: ---C:\codeblocks\prj\example\main.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in
--- End code ---

is this the problem? mingw64 not included in codeblocks installer?



BlueHazzard:
This should only be a problem that you can not stop the debugee...

can you post a full log of the debugger?
You have to turn it on in Settings->Debugger->Full log

sydnytt:
alright, here is full debug log:


--- Code: ---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

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version