views:

69

answers:

2

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  A: 

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

ULysses
Damn, the function that calls native code is QApplication.exec(), it takes no parameters, and *anything* could be happening in there. Is there a technical reason why I don't get a backtrace into the unmanaged code, or is it just a missing feature in VS?
Stefan Monov
+1  A: 

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.

Hans Passant