如何调试来自本机代码的 AccessViolationException

发布于 2024-09-09 21:23:27 字数 203 浏览 3 评论 0原文

我正在编写托管代码,并且正在将托管绑定(qt4dotnet)用于非托管库(Qt)。有时,我会从 Qt 的某个地方收到 AccessViolationException,但我不知道如何调试它。我什至没有得到比托管/非托管边界更远的堆栈跟踪(这意味着我不知道 Qt 的哪一部分在我身上崩溃了)。

顺便说一句,我正在 VS 调试器中运行我的应用程序。

如何调试异常?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

天涯沦落人 2024-09-16 21:23:27

项目+属性,调试选项卡,勾选“启用非托管代码调试”。这仍然不会让事情变得容易,但至少你可以在它爆炸时查看非托管堆栈帧。确保您已获得 Qt 代码的 .pdb 文件。

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.

陌路终见情 2024-09-16 21:23:27

仅通过检查提供给调用本机代码的函数的参数。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文