[PATCH v3 0/7] Fix handling of pending fork events

Simon Marchi simon.marchi@polymtl.ca
Wed Dec 1 14:44:53 GMT 2021


From: Simon Marchi <simon.marchi@efficios.com>

This is v3 of:

    https://sourceware.org/pipermail/gdb-patches/2021-November/183797.html

The series grew a little bit:

  - gdbserver: hide fork child threads from GDB

    Don't move the fork_relative field to thread_info, add a new target
    method instead.

  - gdb/linux-nat: factor ptrace-detach code to new detach_one_pid function

    No changes.

  - gdbserver: suppress "Detaching from process" message

    New, makes testing in last patch easier.  Potentially controversial.

  - gdb/remote.c: move some things up

    New, trivial changes.

  - gdb/remote.c: refactor pending fork status functions

    New, small refactor to clean things up.

  - gdb: move clearing of tp->pending_follow to follow_fork_inferior

    New, fix necessary for last patch.

  - gdb, gdbserver: detach fork child when detaching from fork parent

    Handle detaching after a "catch fork" stop.  Handle fork statuses in
    pending stop replies in the remote target, add new test for this.


Simon Marchi (7):
  gdbserver: hide fork child threads from GDB
  gdb/linux-nat: factor ptrace-detach code to new detach_one_pid
    function
  gdbserver: suppress "Detaching from process" message
  gdb/remote.c: move some things up
  gdb/remote.c: refactor pending fork status functions
  gdb: move clearing of tp->pending_follow to follow_fork_inferior
  gdb, gdbserver: detach fork child when detaching from fork parent

 gdb/infrun.c                                  |  28 ++-
 gdb/linux-nat.c                               | 129 +++++++---
 gdb/remote.c                                  | 232 ++++++++++--------
 .../pending-fork-event-detach-ns.c            |  98 ++++++++
 .../pending-fork-event-detach-ns.exp          |  67 +++++
 .../pending-fork-event-detach-touch-file.c    |  26 ++
 .../gdb.threads/pending-fork-event-detach.c   |  86 +++++++
 .../gdb.threads/pending-fork-event-detach.exp | 127 ++++++++++
 gdb/testsuite/lib/gdb.exp                     |  21 ++
 gdbserver/linux-low.cc                        |  22 ++
 gdbserver/linux-low.h                         |  56 +++++
 gdbserver/server.cc                           |  36 ++-
 gdbserver/target.cc                           |  12 +
 gdbserver/target.h                            |  20 ++
 14 files changed, 806 insertions(+), 154 deletions(-)
 create mode 100644 gdb/testsuite/gdb.threads/pending-fork-event-detach-ns.c
 create mode 100644 gdb/testsuite/gdb.threads/pending-fork-event-detach-ns.exp
 create mode 100644 gdb/testsuite/gdb.threads/pending-fork-event-detach-touch-file.c
 create mode 100644 gdb/testsuite/gdb.threads/pending-fork-event-detach.c
 create mode 100644 gdb/testsuite/gdb.threads/pending-fork-event-detach.exp

-- 
2.33.1



More information about the Gdb-patches mailing list