How to read the C++ CLI .obj files (result of compilation of a single file)

╄→гoц情女王★ 提交于 2020-01-06 04:45:08

问题


I have a small (<300 lines) C++ file in a C++ CLI project in Visual Studio 2010. I have crafted some macros which do different things depending on the Debug/Release configurations.

I would like to be able to look at the resulting .obj files (when I compile in Debug and Release) and be able to compare the two. The hard part is that files are binary and I do not understand their format.

I am sure there are other ways to ensure that the macro is not destructive - e.g. try it out at runtime in both modes, but that is a lot more time consuming. Plus, it would be cool to learn what those .obj have in them.

Thanks, let me know if you have questions.


回答1:


Dumpbin.exe has some options to peek an the .obj file content. Building the final DLL and looking at either the generated machine code with the debugger or the IL with Ildasm.exe or Reflector ought to be a lot more productive.



来源:https://stackoverflow.com/questions/3822433/how-to-read-the-c-cli-obj-files-result-of-compilation-of-a-single-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!