如何阅读C ++ CLI .OBJ文件(单个文件的汇编结果) [英] How to read the C++ CLI .obj files (result of compilation of a single file)

查看:183
本文介绍了如何阅读C ++ CLI .OBJ文件(单个文件的汇编结果)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小(小于300线)在C ++ CLI项目在Visual Studio 2010中的C ++文件。
我已经制作了一些宏里面做取决于调试/发布配置不同的东西。

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.

我希望能够看到所产生的.obj文件(当我在调试和发布编译),并能够比较两个。困难的部分是,文件是二进制的,我不理解他们的格式。

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.

我肯定还有其他的方法,以确保宏是不是破坏性的 - 例如,尝试一下在这两种模式下运行,但这是很多更费时。此外,它会很酷学什么的.OBJ中都有。

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.

推荐答案

DUMPBIN.EXE有一些选项来偷看一个.obj文件的内容。构建最终的DLL,看着无论是生成的机器code与调试器或程序Ildasm.exe或反思的IL应该是一个很大的工作效率。

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.

这篇关于如何阅读C ++ CLI .OBJ文件(单个文件的汇编结果)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆