IDebugControl::WaitForEvent 工作一次然后返回 E_HANDLE

发布于 2024-07-09 14:09:36 字数 1021 浏览 6 评论 0原文

我正在尝试制作一个使用 调试器引擎 API< /a>,但我的成功非常有限。

我可以获得我的 IDebugClientIDebugControl 实例,从那里我可以附加到已经运行的用户进程中。 然后,我进入一个主循环,在其中调用 WaitForEventOutputStackTraceSetExecutionStatus(DEBUG_STATUS_GO),然后重复。 本质上,这将是一个非常粗略的基于采样的分析器。

到目前为止还不错..

我的循环运行了一次完整迭代,我可以看到显示堆栈跟踪,然后目标进程返回到运行状态。

我遇到的问题是,在第二次迭代中,对 WaitForEvent 的调用返回 E_HANDLE (“句柄无效”)。 我在文档中看不到为什么应该返回此错误。 有谁知道为什么会发生这种情况?

I'm trying to make a small tool that makes use of the Debugger Engine API, but I'm having very limited success.

I can get my IDebugClient and IDebugControl instances, and from there I am able to attach into an already running user process. I then enter a main loop where I call WaitForEvent, OutputStackTrace, SetExecutionStatus(DEBUG_STATUS_GO), and repeat. In essence this will be a very crude sampling based profiler.

Good so far..

My loop runs for one full iteration, I can see a stack trace being displayed and then the target process going back into a running state.

The problem I have is that on my 2nd iteration the call to WaitForEvent returns E_HANDLE ("The handle is invalid"). I cannot see in the documentation why this error should be returned. Does anyone know why this might be happening?

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

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

发布评论

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

评论(1

时光与爱终年不遇 2024-07-16 14:09:36

问题是我正在针对旧版本的 SDK 进行编译、链接和运行。 现在我已经将 SDK 升级到最新版本(我认为是在线文档引用的版本),我得到的行为至少与文档一致。

我仍然有问题,但不再是这个问题。

The problem turned out to be that I was compiling, linking, and running against an old version of the SDK. Now that I've upgraded my SDK to the latest version (which I presume is the version that the online docs refer to) I get behaviour that is at least consistent with the docs.

I still have problems, but no longer this problem.

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