在 dbx 中单步执行时的 tb_event_death

发布于 2024-07-10 07:52:59 字数 303 浏览 7 评论 0原文

当我单步执行多线程程序的一个线程时,调试器会被中断:

0x(some hex ref) : tdb_event_death      : ret
dbx: thread has exited -- next aborted

我猜我正在调试的程序中某处的一个线程已经停止,但它不是我正在调试的线程,所以我看不到为什么我必须重新启动调试过程才能继续。

我有一个解决方法,我在下一行设置一个断点然后重新运行,这可以工作但非常烦人,它确实减慢了我的调试速度。 有谁知道更好的方法吗? (例如单步所有线程)

When I am single stepping through one thread of a multi threaded program, the debugger gets interrupted with:

0x(some hex ref) : tdb_event_death      : ret
dbx: thread has exited -- next aborted

My guess is a thread somewhere in the program I am debugging has stopped, but it's not the one I'm debugging so I can't see why I have to restart the debugging process to continue.

I have a work around, I set a breakpoint on the next line then rerun, which works but is very annoying, it is really slowing down my debugging. Does anyone know a better way ? (single step ALL threads for example)

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

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

发布评论

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

评论(2

月亮邮递员 2024-07-17 07:52:59

可能发生的情况是其他某个线程已退出(执行 next 会恢复进程中的所有线程,而不仅仅是您正在调试的线程)。 您可以验证这一点:当您开始调试特定位置时执行thread,并在收到next aborted消息时再次执行。

如果您正在调试的线程不需要与其他线程交互,则可以使用 next 恢复该线程(其中 thread_id 是 < code>thread 命令打印)。

需要注意的是:如果您的线程需要 malloc() 一些内存,您可能必须恢复其他线程,因为其中一个线程可能持有例如 malloc 锁。

What is likely happening is that some other thread has exited (doing next resumes all threads in the process, not just the one you are debugging). You can verify this: do thread when you start debugging a particular place, and again when you get the next aborted message.

If the thread you are debugging doesn't need to interact with other threads, you can resume just that one thread with next <thread_id> (where thread_id is the one thread command prints).

A word of caution: if your thread needs to malloc() some memory, you may have to resume other threads, because one of them could be holding e.g. malloc lock.

北渚 2024-07-17 07:52:59

尝试将环境变量 _THREAD_ERROR_DETECTION 设置为 0

一些简单的阅读

try setting you environment variable _THREAD_ERROR_DETECTION to 0

some light reading

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