Code::Blocks Forums

User forums => Help => Topic started by: RickF- on November 14, 2015, 10:58:47 pm

Title: debugging symbols for .c files
Post by: RickF- on November 14, 2015, 10:58:47 pm
I'm building source code from a standard "C" project. I created a CMakeLists.txt file and then generated a codeblocks makefile project.

I have compiler settings Produce Debugging symbols checked and strip all symbols off.

When I look at  the log it shows:


/usr/bin/cc     -o CMakeFiles/XXX.dir/xxxx.c.o   -c /media/rickf/SSD//xxxx.c


so it seems like no -g is being passed to the cc command.

Symbols show up in the Management window, however, and seem correct, but when I go to debug



Adding source dir: /media/rickf/SSD/
Adding file: /media/rickf/SSD/<AppName>
Changing directory to: /media/rickf/SSD/<FolderWhereAppNameIs>
Set variable: LD_LIBRARY_PATH=.:

[debug]Command-line: /usr/bin/gdb -nx -fullname  -quiet  -args /media/rickf/SSD/<AppName>
[debug]Working dir : /media/rickf/SSD/<FolderWhereAppNameIs>

Starting debugger: /usr/bin/gdb -nx -fullname  -quiet  -args /media/rickf/SSD/<AppName>
done

[debug]Reading symbols from /media/rickf/SSD/<AppName>
[debug](no debugging symbols found)...done.
[debug](gdb)

Is this  a bug, or, do I need to set up something differently?

Also, it seems with the Cmake project I don't get debug/release build targets, but instead <AppName> and <AppName fast>

Thanks

R.
Title: Re: debugging symbols for .c files
Post by: RickF- on November 14, 2015, 11:05:34 pm
I'm going to answer my own question: I had to set the CMAKE_CXX_FLAGS to -g which is supposed to be release builds but I'll live with it for now.
Title: Re: debugging symbols for .c files
Post by: scarphin on November 15, 2015, 12:16:24 am
If you use a makefile, compiler switches set in codeblocks are ignored. It won't do any good if the makefile cannot control the build process.