How to debug AccessViolationException coming from native code
I'm writing managed code, and I'm using managed bindings (qt4dotnet) for开发者_Go百科 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?
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.
only by inspecting parameters given to a function that calls native code.
精彩评论