How to debug AccessViolationException coming from native code

南楼画角 提交于 2019-12-10 23:21:54

问题


I'm writing managed code, and I'm using managed bindings (qt4dotnet) for an unmanaged library (Qt). Now and then, I get an AccessViolationException coming somewhere from Qt, but I don't know how to debug that. I don't even get a stacktrace further than the managed/unmanaged boundary (meaning I don't know what part of Qt crashed on me).

By the way, I'm running my app inside the VS debugger.

How do I debug the exception?


回答1:


Project + Properties, Debug tab, tick "Enable unmanaged code debugging". This still won't make it easy, but at least you can look at the unmanaged stack frames when it bombs. Make sure you've got the .pdb files for the Qt code.




回答2:


only by inspecting parameters given to a function that calls native code.



来源:https://stackoverflow.com/questions/3245185/how-to-debug-accessviolationexception-coming-from-native-code

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