[question] how to attach first thread of process

wupeijun lonependulm@gmail.com
Sat Nov 23 07:30:00 GMT 2019


When I use `attach $pid` in gdb,
1) if the pid is a thread id, the thread specified was stoped and others
just continue running. 2) But where pid is a process id gdb attach to the
process and all thread in that process stoped.

After read the manpage[1] and do some experiments, I found that ptrace was
worked on thread level, So, is there a way for gdb only attach first thread
when attach to process id.

[1] http://man7.org/linux/man-pages/man2/ptrace.2.html

Thanks. Regards

More information about the Gdb mailing list