Stepping into a P/Invoke call in disassemby view

一个人想着一个人 提交于 2019-12-03 11:38:55
Daniel Protopopov

This may help you solve the problem: (by Graviton)

CallingConvention = CallingConvention.Cdecl

Also this mentions that you need to detach managed debugger and re-attach unmanaged when crossing the boundaries. You might need to check the capabilities of mixed debugger and it's preferences from MSDN.

And finally, using Ed Dore' answer:

Under Tools.Options dialog, select the Debugging category, and make sure the "Enable Just My Code" setting is unchecked. From the Project properties, select the Debug tab, and then ensure that "Enable unmanaged code debugging" is checked.

Once you've got these squared away, you should get the mixed mode debugging support working.

Also, if you use "Debug.Attach To Process" , be sure to hit the "Select..." button in the "Attach To Process" dialog, and select both Managed and Native debugging support.

One thing I would try is going from C# to C++/CLI code, and then from C++ to the third-party code. Once you're in C++ (and free of the P/Invoke infrastructure), you might have better luck with the disassembly view.

Kendall Frey

In your C# project properties, in the Debug tab, check Enable native code debugging. Worked for me in VS 2012.

Credit goes to billb.

Also, since it's a third party library, ensure Enable Just My Code is unchecked in Options > Debugging.

I had a similar issue where I was debugging a C# exe that called my own C++ dll via PInvoke, all part of the same solution. Enabling native code debugging in my c# project allowed me to debug my C++ code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!