Monday, December 21, 2015

"No debugging symbols found" in gdb after compiling 3D Toolkit on Linux with CMake

I wanted to step through the source code as I execute the 3D Toolkit show program on Linux but the gdb debugger was unable to load debugging symbols, as shown in the screenshot below.

Previously, I compiled the application with the "make" command but by default, it created build instead of debug executables. So I had to enable debug compilation. In order to do that, I had to do the following:

  1. Open up the 3D Toolkit's CMakeList.txt file in a text editor.


  2. Locate the line

    set (CMAKE_BUILD_TYPE "" CACHE INTERNAL "" FORCE)
  3. Change the above line to the following:

    set (CMAKE_BUILD_TYPE "Debug")


  4. Now recompile the application.
Now, the debugger gdb should be able to load the debug symbols and the source code can be stepped through, as shown below.

 

No comments: