I have built gdb-7.12 with python support and have enabled pretty printing and configured my gdbinit file by following https://sourceware.org/gdb/wiki/STLSupport.
But whenever i print the size of any container:
p ivec.size()
Cannot evaluate function -- may be inlined
Here is the MCVE i am using
#include <vector>
using namespace std;
int main(){
vector<int> ivec;
return 0;
}
I have tried different compiling options
g++-6 -g -O0 -fno-inline-functions -gdwarf-2 Source.cpp --std=c++14
In fact i have tried every combination of the above options, and always the same problem.
I tried switching to gdb-7.11 (also built from source) to see if it fixes the problem and also switched to g++-4.8, none of them seem to fix the issue.
What am i doing wrong? Is there some specific order in which you have to give the options?
EDIT: Many people have suggested some macros to solve the problem, but my problem isn't to somehow print these functions, i can write my own pretty print methods for that.
My question is why are the functions showing up as inlined even after Disabling optimizations with -O0 options?