[0/3] Better error handling when creating threads with clone()

Message ID cover.1775557188.git.aburgess@redhat.com
Headers
Series Better error handling when creating threads with clone() |

Message

Andrew Burgess April 7, 2026, 10:22 a.m. UTC
  A Fedora GDB bug got me looking at error handling relating to GDB's
clone handling, and thread-db thread adoption.

The first two patches are some refactoring in this area, and the third
patch changes and improves error handling so that GDB is better able
to track threads even if thread-db thread adoption fails.

Thanks,
Andrew

---

Andrew Burgess (3):
  gdb: int to bool conversion in linux-thread-db.c
  gdb: add some asserts to thread_db_notice_clone
  gdb: improve error handling for thread-db thread adoption

 gdb/linux-nat.c                             |  25 +-
 gdb/linux-nat.h                             |   2 +-
 gdb/linux-thread-db.c                       |  67 +++--
 gdb/testsuite/gdb.threads/clone-bad-tls.c   | 193 +++++++++++++
 gdb/testsuite/gdb.threads/clone-bad-tls.exp | 294 ++++++++++++++++++++
 gdbserver/thread-db.cc                      |  14 +-
 6 files changed, 553 insertions(+), 42 deletions(-)
 create mode 100644 gdb/testsuite/gdb.threads/clone-bad-tls.c
 create mode 100644 gdb/testsuite/gdb.threads/clone-bad-tls.exp


base-commit: 9d3cf9efd51ebae3f45bb49e3544cb7eeb63a138