Boost is a great set of libraries and it really boosts productivity. But debugging code that uses it is a total nightmare. Sure, stepping through twenty thousand header files can be a valuable intellectual exercise, but what if you need to do it over and over again?
Is there a developer-friendly way of just skipping the boost portion and having the debugger go straight to my code?
Visual Studio has a DebuggerStepThroughAttribute for .NET framework. Is there anything similar for native C++?
There's no platform/compiler independent way, but I've been told that you can tell the debugger to not "step into" certain functions or classes. You should look up the registry key: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\NativeDE\StepOver]
and create a string value named as a number in the order the rules should apply (I'm a bit confused about it too, but I guess that the rules are simply ordered in the (possibly reverse) way they should be applied) and set it to something like: "boost::.*=NoStepInto". E.g.:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\NativeDE\StepOver]
"10"="boost\:\:.*=NoStepInto"
You can read a little bit more here.
You can skip the boost namespace entirely by using the techniques described here. Just use something like:
boost\:\:.*=NoStepInto
... in the relevant registry entry.
However if your code gets called from within boost (e.g. through a boost::function
or similar) then your code will be skipped as well! I'll be interested if someone can come up with a good solution for that problem...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With