How to debug macros efficiently in VS?

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

    If you want to see the expanded code generated by the preprocessor then you can get it using the -E flag using gcc. The command would be like this:

    $ gcc -E  -o 
    

    You can replace the original source code using macro with the expanded code and place whatever break point that you want to place there.

提交回复
热议问题