Reputation: 11
I am using Clion IDe, with gcc/g++ & gdb for debugger.
In the CMakeList.txt, I have the following compiler options set.
set(CMAKE_CXX_FLAGS -std=c++11 -fopenmp -fPIC -O0 -gdwarf-2 -finline-functions)
I can view the variable values in main() but not any other classes. It shows the error for all methods called from the main directly or nested :
<error reading variable: Could not find the frame base for xxxxclass::xxxMethod>
Any pointer would be helpful.
Upvotes: 0
Views: 1661
Reputation: 5661
Several problems I see:
-gdwarf-2
) unless your debugger cannot handle newer dwarf revisions.-O0
should correctly disable -finline-functions
though). But note that newer dwarf revisions better handle and track optimizations.-g
takes an optional argument which is 2
by default, but whose maximum value can be 3
. It will then unlock some debugger features like debugging CPP macros.-ggdb
.So, try again with:
set(CMAKE_CXX_FLAGS -std=c++11 -fopenmp -fPIC -O0 -g3 -ggdb)
Upvotes: 1