Author Topic: debugging symbols for .c files  (Read 1729 times)

Offline RickF-

  • Single posting newcomer
  • *
  • Posts: 2
debugging symbols for .c files
« 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.

Offline RickF-

  • Single posting newcomer
  • *
  • Posts: 2
Re: debugging symbols for .c files
« Reply #1 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.

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: debugging symbols for .c files
« Reply #2 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.