【问题标题】:VSCode natvis working on some variables but not others of the same template typeVSCode natvis 处理某些变量,但不处理相同模板类型的其他变量
【发布时间】:2021-06-17 22:37:26
【问题描述】:

在 Android 的 NDK 上使用上述 std::vectors。如果我为 std::__ndk1::vector_base 定义 natvis 如下

    <Type Name="std::__ndk1::__vector_base&lt;*&gt;">
        <DisplayString>{{size={__end_ - __begin_}}}</DisplayString>
        <Expand>
            <Item Name="[size]" ExcludeView="simple">__end_ - __begin_</Item>
            <Item Name="[capacity]" ExcludeView="simple">__end_cap_.__value_ - __begin_</Item>
            <ArrayItems>
                <Size>__end_ - __begin_</Size>
                <ValuePointer>__begin_</ValuePointer>
            </ArrayItems>
        </Expand>
    </Type>

我得到以下信息

为什么 natvis 定义适用于 unsigned char 而不是 unsigned long

【问题讨论】:

    标签: visual-studio-code natvis


    【解决方案1】:

    看起来这可能是 VSCode 中的一个错误,因为在 2020 年 8 月报告了一个错误(现已关闭),这似乎暗示在模板中使用 unsigned long 时存在问题。

    https://github.com/microsoft/vscode-cpptools/issues/5253

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-22
      • 2014-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多