VS插件,用于快速查看preprocessed或汇编输出 [英] VS addin for quickly viewing preprocessed or assembly output

查看:606
本文介绍了VS插件,用于快速查看preprocessed或汇编输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找一键的方式来检查preprocessed或装配输出。
这只是乏味的打开文件属性,更改相应的设置,编译,去obj的目录,并用手打开生成的文件。

I'm searching for a one-click way to inspect preprocessed or assembly output. It's just tedious to open file properties, change the respective setting, compile, go to the obj directory and open the resulting file by hand.

有谁知道任何Visual Studio的插件,宏或其他自动运行该任务?

Does anyone know of any Visual Studio add-in, macro or whatever to automate this task?

推荐答案

编辑:为VS 11+的扩展可@的 https://github.com/Trass3r/DevUtils

An extension for VS 11+ is available @ https://github.com/Trass3r/DevUtils

我通过创建一个很好的宏观解决它自己。
它的方式更加复杂,但基本上是这样的:

I solved it myself by creating a nice macro. It's way more sophisticated but basically works like this:

Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Dim doc As EnvDTE.Document = DTE.ActiveDocument
Dim prj As VCProject = doc.ProjectItem.ContainingProject.Object

Dim file As VCFile = prj.Files.Item(doc.Name)
Dim fileconfigs As IVCCollection = file.FileConfigurations
Dim fileconfig As VCFileConfiguration = fileconfigs.Item("Release|x64")
Dim tool As VCCLCompilerTool = fileconfig.Tool

Dim asmFile = System.IO.Path.GetTempFileName + ".asm"
tool.WholeProgramOptimization = False
tool.AssemblerOutput = asmListingOption.asmListingAsmSrc
tool.AssemblerListingLocation = asmFile

fileconfig.Compile(True, True)
Dim window = DTE.ItemOperations.OpenFile(asmFile, Constants.vsViewKindCode)

结合 AsmHighlighter

preprocessed文件

Preprocessed file can be generated similarly with

tool.GeneratePreprocessedFile = preprocessOption.preprocessYes
' there's no separate option for this, so misuse /Fo
tool.ObjectFile = System.IO.Path.GetTempFileName + ".cpp"

这篇关于VS插件,用于快速查看preprocessed或汇编输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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