简体   繁体   English

'调试' visual studio code.natvis 基于自定义视图对象

[英]'Debugging' visual studio code .natvis based custom view objects

I would like to provide some.natvis file based C++ custom view objects for Visual Studio Code.我想为 Visual Studio Code 提供基于 C++ 自定义视图对象的 some.natvis 文件。 It is not working as expected out of the box and the definitions used in the.natvis file are not used to display the intended objects during a debugging session. I added the custom.navis file to the launch.json and followed all best practices I could find.它没有按预期开箱即用,并且 .natvis 文件中使用的定义未用于在调试期间显示预期对象 session。我将 custom.navis 文件添加到 launch.json 并遵循了我的所有最佳实践能找到。

Now I'm at the point where some feedback about the parsed.natvis content would be helpful to find the error.现在,关于 parsed.natvis 内容的一些反馈将有助于找到错误。 Is it possible to get log outputs or more about these definitions in a Visual Studio Code session to be able to find my error?是否有可能在 Visual Studio 代码 session 中获取日志输出或更多关于这些定义的信息,以便能够找到我的错误?

Yes it is, but I don't have experience with VS Code, only Visual Studio.是的,但我没有使用 VS Code 的经验,只有 Visual Studio。 But presumably you have Visual Studio installed if you are using natvis?但是,如果您使用的是 natvis,大概您已经安装了 Visual Studio? If not then maybe you could download it, to fix your natvis errors.如果没有,那么也许您可以下载它,以修复您的 natvis 错误。

In Visual Studio go to在 Visual Studio go 中

Tools/Options/Debugging/Output Window/General Output Settings/Natvis Diagnostic Messages

Set to Error or Verbose设置为ErrorVerbose

Error messages appear in the output window when you start debugging your program.当您开始调试程序时,错误信息出现在 output window 中。 I found that you get one error message at a time.我发现您一次收到一条错误消息。 So if your natvis file has several errors it will take a while to fix them all.因此,如果您的 natvis 文件有多个错误,则需要一段时间才能全部修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM