diff options
author | Kamil Rytarowski <n54@gmx.com> | 2020-03-25 20:29:44 +0100 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2020-04-06 23:04:36 +0200 |
commit | 05f00e223d56927bfb03e3272a4827276ed67372 (patch) | |
tree | c01229abb010a78b721e0b69578eaf5985b17caa /gdbserver/linux-x86-low.cc | |
parent | 6ee448cc2d0b9337713ecb6bb2e6305b4f504cbc (diff) | |
download | gdb-05f00e223d56927bfb03e3272a4827276ed67372.zip gdb-05f00e223d56927bfb03e3272a4827276ed67372.tar.gz gdb-05f00e223d56927bfb03e3272a4827276ed67372.tar.bz2 |
Implement basic threading support in the NetBSD target
Use sysctl(3) as the portable interface to prompt NetBSD threads on
all supported NetBSD versions. In future newer versions could switch
to PT_LWPSTATUS ptrace(2) API that will be supported on NetBSD 10.0
and newer.
Implement as part of nbsd_nat_target:
- thread_name() - read descriptive thread name
- thread_alive() - check whether a thread is alive
- post_attach() - updates the list of threads after attach
- update_thread_list() - updates the list of threads
- pid_to_str() - translates ptid to a descriptive string
There are two local static functions:
- nbsd_thread_lister() - generic LWP lister for a specified pid
- nbsd_add_threads() - utility to update the list of threads
Now, GDB on NetBSD can attach to a multithreaded process, spawn
a multithreaded process, list threads, print their LWP+PID numbers
and descriptive thread names.
gdb/ChangeLog:
* nbsd-nat.h (struct thread_info): Add forward declaration.
(nbsd_nat_target::thread_alive): Add.
(nbsd_nat_target::thread_name): Likewise.
(nbsd_nat_target::update_thread_list): Likewise.
(update_thread_list::post_attach): Likewise.
(post_attach::pid_to_str): Likewise.
* nbsd-nat.c: Include "gdbthread.h" and "inferior.h".
(nbsd_thread_lister): Add.
(nbsd_nat_target::thread_alive): Likewise.
(nbsd_nat_target::thread_name): Likewise.
(nbsd_add_threads): Likewise.
(update_thread_list::post_attach): Likewise.
(nbsd_nat_target::update_thread_list): Likewise.
(post_attach::pid_to_str): Likewise.
Diffstat (limited to 'gdbserver/linux-x86-low.cc')
0 files changed, 0 insertions, 0 deletions