Determining the correct thread to debug in GDB

后端 未结 2 876
感动是毒
感动是毒 2021-02-14 07:32

I\'ve run into some problems debugging a multi-threaded process using GDB. I have a multi-threaded process that splinters off into several (8 or 9) different threads, and I am t

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-14 08:21

    I find myself doing this all the time:

    > t a a f
    

    Short for:

    > thread apply all frame
    

    Of course, other variants are possible:

    > t a a bt 3
    

    Which prints the bottom 3 frames of each thread's stack. (You can also use negative numbers to get the top N frames of the stack)

提交回复
热议问题