Is there a Visual Studio macro to set a breakpoint on the start of every method in a class?

后端 未结 3 527
醉酒成梦
醉酒成梦 2021-01-20 13:09

Is there a Visual Studio macro (either for version 2008 or 2010) to set a breakpoint on the start of every method in a class?

I\'ve seen hints of references, but I\'

相关标签:
3条回答
  • 2021-01-20 13:50

    There are some good ideas here: How to put breakpoint in every function of .cpp file?

    0 讨论(0)
  • 2021-01-20 13:56

    Wouldn't you be better off just single-stepping through your source code?

    I can't imagine why a breakpoint at the start of every method would be any better than single-stepping. You're going to end up breaking everywhere anyway, and single-stepping provides the additional advantage of showing you the logical flow of your code paths.

    You'll probably definitely want to learn the keyboard shortcut keys, but they can depend on how you have your VS environment set up. Look in your "Debug" menu for the "Step Over" and "Step Into" items. (Normally, Step Over is F10 and Step Into is F11.) The only difference is that, if the currently highlighted line contains a function call, Step Into will allow you to single-step through the code in the called function (this is probably most like what you want to do), while Step Over will simply call the function and stop on the next line in the current function.

    0 讨论(0)
  • 2021-01-20 14:00

    A Visual Studio extension named OzCode does have a feature to set/unset breakpoints on all members of a class. I use this extension a lot, as it has some very nice debugging enhancements.

    Admittedly though, I haven't used the set/unset breakpoint feature much, but it's an option for you.

    0 讨论(0)
提交回复
热议问题