开发者

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?

The project is a c++ project 开发者_开发百科in a c++ solution. The dynamic lib is 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.

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. Now I get only clr related dlls in that window + mine. All the runtime native dlls no longer get listed in that window. 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. The ide will autoselect the right one. 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.

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.


Per MSDN forum post.

Disable the setting:

Properties -> Configuration Properites -> C/C++ -> Optimization -> Optimization: Disabled(/Od)

Enable the setting:

Properties -> Configuration Properites -> Linker-> Debugging-> Generate Map File:Yes(/MAP)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜