如何在VS中高效地调试宏? [英] How to debug macros efficiently in VS?
问题描述
我想在其中放置一个断点。
(是的,我知道宏是坏的。)
通过右键单击并转到属性,转到项目或源文件属性。在配置属性 - > C / C ++ - >预处理器下,将生成预处理文件设置为带或不带行号,无论您选择哪种。这将显示您的宏在上下文中的扩展。如果您需要在实时编译代码中进行调试,只需剪切并粘贴即可,并在调试时将其替换为宏。
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?
F.e. I'd like to place a breakpoint inside it.
(Yes, I know macros are bad.)
Go to either project or source file properties by right-clicking and going to "Properties". Under Configuration Properties->C/C++->Preprocessor, set "Generate Preprocessed File" to either with or without line numbers, whichever you prefer. This will show what your macro expands to in context. If you need to debug it on live compiled code, just cut and paste that, and put it in place of your macro while debugging.
这篇关于如何在VS中高效地调试宏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!