Getting stacktrace of all threads without attaching GDB

后端 未结 6 863
甜味超标
甜味超标 2021-02-13 16:24

Is there a way to print stacktrace of all threads without attaching GDB?

Or is there a command which I can use as gdb batch mode to print stacktrace of all threads?

6条回答
  •  北荒
    北荒 (楼主)
    2021-02-13 16:35

    pstack?

    Usage:

    pstack 
    

    From the man page:

    pstack - print a stack trace of a running process
    ...
    If the process is part of a thread group, then pstack will print out a stack trace for each of the threads in the group.
    

提交回复
热议问题