在 dbx 中单步执行时的 tb_event_death
当我单步执行多线程程序的一个线程时,调试器会被中断:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可能发生的情况是其他某个线程已退出(执行
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: dothread
when you start debugging a particular place, and again when you get thenext 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>
(wherethread_id
is the onethread
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.尝试将环境变量 _THREAD_ERROR_DETECTION 设置为 0
一些简单的阅读
try setting you environment variable _THREAD_ERROR_DETECTION to 0
some light reading