问题描述
我在C ++ / CLI中使用混合模式程序集。所有管理模式组装pdb的成功时在混合模式装配,但本机dll和pdb的不被加载,即使本机pdb的信息显示在模块窗格中(即在VS Debug-> Windows->模块)。 / p>
我使用本地dll并在C ++ / CLI代码中的混合程序集中调用其导出的函数。这里,函数成功调用,但本地pdb符号不加载,并且本机代码中的所有断点都显示为空心圆,工具提示说没有为此加载符号。
我已经做了一切,pdb放置在当前目录中被管理进程启动的地方;删除所有obj和调试文件夹,并在同一时间重新编译每个项目;我甚至使用ChkMatch实用程序,显示Exe中的符号和对应的pdb匹配。
有没有任何方法来启用本机代码的断点, / LCI混合模式)代码?
尊敬的,
Usman
混合模式调试可以命中和错过,多数错过。首先检查你是否已经启用混合模式调试。从C#项目,它是项目+属性,调试,启用非托管代码调试复选框。接下来,64位进程不启用混合模式调试。如果在64位操作系统上运行,请确保强制.exe在32位模式下运行。项目+属性,构建选项卡,平台目标= x86。
下一步验证调试器查找.pdb文件的位置。在Debug + Windows + Modules窗口中,右键单击DLL并选择Symbol load information。最后一点是在非托管代码中使用__debugbreak()。
I am working with mixed mode assemblies in C++/CLI. All managed mode assembled pdb's get loaded when successfully in mixed mode assembly, but native dll's and pdb's are not getting loaded even though the information of native pdb's is shown in the Modules pane (i.e. in VS Debug->Windows->Modules).
I am using native dll and calling its exported function in mixed assembly in C++/CLI code. Here, functions get called successfully, but native pdb symbols are not loading and all breakpoints in the native code are shown as hollow circle and tool tips says there are no symbols loaded for this.
I have done everything, pdb placed in current directory to where the managed process is launched; deleted all obj and debug folders and recompiled every project at the same time; I even used the ChkMatch utility which shows that the symbols in the Exe and corresponding pdb match.
Is there any way to enable breakpoints of native code while calling from managed (C++/LCI Mixed mode) code?
Regards,
Usman
Mixed-mode debugging can be hit and miss, mostly miss. First check that you've actually have mixed-mode debugging enabled. From a C# project, it is Project + Properties, Debug, Enabled unmanaged code debugging check box. Next, mixed-mode debugging is not enabled for 64-bit processes. If you run on a 64-bit operating system, make sure you force the .exe to run in 32-bit mode. Project + Properties, Build tab, Platform Target = x86.
Next verify where the debugger looked for the .pdb files. From the Debug + Windows + Modules window, right-click the DLL and select "Symbol load information". Final gasp is to use __debugbreak() in the unmanaged code.
这篇关于混合模式程序集不加载本机C ++ pdbs的符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!