> I’m surprised it requires so much effort. On Windows you pretty just need to make a debug build and... that’s it!
Well, except the Debug build in MSVC doesn't do half of the things from
this list. Also, the list tells you how to use the compilation driver
directly, so when comparing stuff, you would need to use the "cl.exe"
compiler. For a "default" debugging experience it's enough to use
CMake's Debug build type. It even has a built-in "release with debug
info" build type.
I guess that means not using cmake but using sln and vcxproj and friends, my experience with those was that it's pretty terrible for anything bigger than simple dummy projects.
I mean, to be fair, if you're fiddling with/invoking cl.exe manually then you'd need to know a lot of the general equivalents and nits listed here. MSVC's debug build will do a lot for you out of the box though which is great. That said you often have to support/know 400 random build tools when using C++ to enable things like this, so it's often useful knowledge anyway.
A nice trick with MSVC is you can turn off optimizations for TU or any block of code with:
Leaps and bounds easier than hacking the build the system.