[question] how to attach first thread of process

wupeijun <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CALGYOxNWR-gRC3rVUCSe0PXAJdwHi7ewqJbex-4H+SP--X5b9Q@mail.gmail.com>
Hi,

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.