How to debug macros efficiently in VS?

前端 未结 9 1880
情书的邮戳
情书的邮戳 2021-02-01 22:38

I\'ve got a pretty complicated macro inside my (unmanaged) C++ code. Is there any way to expand macros in VS debugger? Or maybe there is another way to debug macros there?

9条回答
  •  你的背包
    2021-02-01 22:50

    The compiler expands macros nicely. Get a compilation listing with the macros expanded.

    Insert the expanded macro into your code. Recompile and you should be able to step through it, to do a simple test.

    Generally when I am building a complicated macro, I hard code it first, and test it. Then I turn it into a macro.

    For 2008, this may be of help

提交回复
热议问题