How to debug macros efficiently in VS?

前端 未结 9 1740
情书的邮戳
情书的邮戳 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:45

    Yes, you can.

    Locate the preprocessed file generated by the preprocessor in the Debug folder.

    So if your macro is written in testing.c file, the preprocessed file would be called testing.i

    There you can see how the macro have been expanded.

    To debug it, just copy paste this code to yours :)

提交回复
热议问题