When a process is bound by gdb, the stat of the process is "T", for example:
root 6507 0.0 0.0 67896 952 ? Ss 12:01 0:00 /mytest
root 6508 0.0 0.0 156472 7120 ? Sl 12:01 0:00 /mytest
root 26994 0.0 0.0 67896 956 ? Ss 19:59 0:00 /mytest
root 26995 0.0 0.0 156460 7116 ? Tl 19:59 0:00 /mytest
root 27833 0.0 0.0 97972 24564 pts/2 S+ 20:00 0:00 gdb /mytest
Of the above, 26995 can be debugged. How can I find out 26995 is debugging or not? Or I can find out which process is related to gdb (27833)
pstree -p 27833 --- show gdb (27833)
Another question: How do I know the process (stat: T) associated with which gdb (PID)? In most cases, I am not a peony who debugs the process.
source
share