Great post. I’m surprised it requires so much effort. On Windows you pretty just need to make a debug build and… that’s it!
A nice trick with MSVC is you can turn off optimizations for TU or any block of code with:
#pragma optimize( "", off )
Leaps and bounds easier than hacking the build the system.