]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ChangeLog
Implement basic threading support in the NetBSD target
authorKamil Rytarowski <n54@gmx.com>
Wed, 25 Mar 2020 19:29:44 +0000 (20:29 +0100)
committerKamil Rytarowski <n54@gmx.com>
Mon, 6 Apr 2020 21:04:36 +0000 (23:04 +0200)
commit05f00e223d56927bfb03e3272a4827276ed67372
treec01229abb010a78b721e0b69578eaf5985b17caa
parent6ee448cc2d0b9337713ecb6bb2e6305b4f504cbc
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.
gdb/ChangeLog
gdb/nbsd-nat.c
gdb/nbsd-nat.h