VS addin for quickly viewing preprocessed or assembly output

匿名 (未验证) 提交于 2019-12-03 10:24:21

问题:

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.

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

回答1:

EDIT: 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) 

Very useful in combination with AsmHighlighter.

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" 


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