Hello every one!
I use Net Beans on Arch Linux. How I turn off optimization in g++, for view values of variables?
I'am trying:
1. "Project properties" > "C++ Compiler" > "Additional options" added -O0.
2. I use "volatile" before variable. For example volatileint length = strlen(str)
When I view variable value, I see "<optimized out>". I building and running as described https://netbeans.org/kb/docs/cnd/debugging.html. I click "Clean and building project" > "Debug project".
Screenshot https://ibb.co/mRCbxyB. I note, if place string int length = strlen(str); (as view the screenshot) in constructor, value of variable "<optimized out>", but place in main(), value viewed correct. I try adding -g, but not working.
I heave read: "if I see "<optimized out>", and don't use variable, then will adding option -O0 into compilation string". It's don't working. Thank's every body!