Visual Studio Debugger displays wrong values for native types

后端 未结 3 1374
暖寄归人
暖寄归人 2021-01-21 16:31

I am writing a program in managed C++ and native C++ using Visual Studio 2008 (Version 9.0.30729.1 SP) and .NET 3.5.
When debugging, Visual Studio displays obviously wrong v

相关标签:
3条回答
  • 2021-01-21 16:37

    It seems that switching the Common Language Runtime Support under Configuration Properties from Pure MSIL Common Language Runtime Support (/clr:pure) to Common Language Runtime Support ( /clr) did the trick. I can now view native objects just fine.

    0 讨论(0)
  • 2021-01-21 16:37

    I don't know what's the type of g_pGame, but it is possible to write extensions for Visual Studio so you can view the values of your custom types. Although that feature is mainly targeted for other use, like you have your own String container and you know it's internal details and you want to simply see the string value in it. So normally it is not for working around misbehavior. Also, writing such extension needs effort, and it won't help the problem with other types. But I want to let you know.

    0 讨论(0)
  • 2021-01-21 16:49

    Try installing KB957912 (Updates for Visual Studio 2008 SP1 debugging and breakpoints), it may help you.

    0 讨论(0)
提交回复
热议问题