It's hard for me to say which flags you should use when calling gcc for debugging. gcc docs note that the default debug flags are -g and -O2 , and using -g -O0 -fno-inline disables any optimization and attachment function.
In my opinion, if you really want to guarantee that nothing will ruin your debugging process, you just need to compile the -g -O0 -fno-inline flags.
coelhudo
source share