gpt4 book ai didi

multithreading - 调试核心文件时找到主线程

转载 作者:行者123 更新时间:2023-12-05 04:11:44 33 4
gpt4 key购买 nike

我有一个程序,其中主线程创建了很多线程。它崩溃了,我正在调试核心文件。崩溃发生在其中一个子线程中。为了找到原因,我需要知道主线程是否还活着。有什么方法可以找出哪个线程是初始线程?

最佳答案

Is there any way to find out which thread was the initial one?

当有 100 个线程时,我使用以下技术来查看它们:

(gdb) shell rm gdb.txt
(gdb) set logging on # GDB output will go to gdb.txt
(gdb) thread apply all where

现在将 gdb.txt 加载到您选择的编辑器或寻呼机中,查找 main 等。

关于multithreading - 调试核心文件时找到主线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42131248/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com