简体   繁体   English

在 c++/cli 程序集 vs2010 调试器中进行调试显示所有本机字段都是<undefined value></undefined>

[英]debugging in c++/cli assembly vs2010 debugger show all native fields are <undefined value>

Has anyone seen this/knows how to get the values in debugger local/autos window?有没有人看到这个/知道如何在调试器本地/汽车 window 中获取值?

The project is a c++ project in a c++ solution.该项目是 c++ 解决方案中的 c++ 项目。 The dynamic lib is build wity /clr.动态库是 build wity /clr。 Due to the nature of the dll i can only debug it by attaching to a third party native process that loads it.由于 dll 的性质,我只能通过附加到加载它的第三方本机进程来调试它。

One interesting thing is that prior to including clr in these type of dlls when i would attach, in the output window i would get a list of all dlls loaded into the process, those would be c++ runtime sdk dlls, the third party native proc dlls and my dlls. One interesting thing is that prior to including clr in these type of dlls when i would attach, in the output window i would get a list of all dlls loaded into the process, those would be c++ runtime sdk dlls, the third party native proc dlls和我的dll。 Now I get only clr related dlls in that window + mine.现在我在 window + mine 中只得到了与 clr 相关的 dll。 All the runtime native dlls no longer get listed in that window. window 中不再列出所有运行时原生 dll。 Its almost like the debugger does not load them for reference.它几乎就像调试器不会加载它们以供参考。

Found the resolution.找到了解决方案。 When creating mixed mode assemblies in the manner describe in the question, it does not matter what debugger one uses in vs2010.当以问题中描述的方式创建混合模式程序集时,在 vs2010 中使用什么调试器并不重要。 The ide will autoselect the right one. ide 将自动选择正确的。 Further more if your attaching, you can use both at the same time .net+native selectable in a combo box list in the "attach to:" section of the Attach to process dialog.此外,如果您附加,您可以在附加到进程对话框的“附加到:”部分的组合框列表中同时使用 .net+native 可选。

What you absolutely have to make sure of is to link with these 3 options: /MAP /MAPINFO:EXPORTS /ASSEMBLYDEBUG located in the Linker/Debugging section in project properties.您必须确保与以下 3 个选项链接: /MAP /MAPINFO:EXPORTS /ASSEMBLYDEBUG 位于项目属性的链接器/调试部分中。

Per MSDN forum post.根据MSDN 论坛帖子。

Disable the setting:禁用设置:

Properties -> Configuration Properites -> C/C++ -> Optimization -> Optimization: Disabled(/Od)属性 -> 配置属性 -> C/C++ -> 优化 -> 优化:禁用(/Od)

Enable the setting:启用设置:

Properties -> Configuration Properites -> Linker-> Debugging-> Generate Map File:Yes(/MAP)属性 -> 配置属性 -> 链接器 -> 调试 -> 生成 Map 文件:是(/MAP)

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

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