VS2015 Visualiser,(*.natvis)DisplayString调用函数显示值

VS2015 Visualiser, (*.natvis) DisplayString call a function to display the value

我有一个复杂的 class,(MyClass),它有一个名为 ToString() 的函数,函数 returns 的字符串表示形式字符串.

我希望 visual studio 可视化工具使用该函数来显示变量

这是我的可视化工具,

<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
  <Type Name="MyClass">
    <DisplayString>...</DisplayString> 
  </Type>
</AutoVisualizer>

如果我用

...
  <DisplayString>{ToString}</DisplayString> 
...

返回了函数的地址,是否可以显示函数的结果?

如果不是,显示 class 的字符串表示形式的最佳方式是什么?

无法调用方法。

来自MSDN Forums

Calling a function from the debugger is playing with fire. You are likely to deadlock on cross thread dependencies (even if you don't have any explicit cross thread dependencies, there are shared locks for things like memory allocation). This is why the C++ debugger has no support for implicit funceval