From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 9B819385802E for ; Tue, 18 Jan 2022 04:09:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9B819385802E X-ASG-Debug-ID: 1642478978-0c856e06ad131be0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id tTeqY3g1xZRYs5hz (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 17 Jan 2022 23:09:38 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by smtp.ebox.ca (Postfix) with ESMTP id 45BE4441B21; Mon, 17 Jan 2022 23:09:38 -0500 (EST) From: Simon Marchi X-Barracuda-RBL-IP: 192.222.157.6 X-Barracuda-Effective-Source-IP: 192-222-157-6.qc.cable.ebox.net[192.222.157.6] X-Barracuda-Apparent-Source-IP: 192.222.157.6 To: gdb-patches@sourceware.org Subject: [PATCH v2 0/9] Some fixes for handling vfork by multi-threaded programs Date: Mon, 17 Jan 2022 23:09:28 -0500 X-ASG-Orig-Subj: [PATCH v2 0/9] Some fixes for handling vfork by multi-threaded programs Message-Id: <20220118040937.730282-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1642478978 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 2605 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.50 X-Barracuda-Spam-Status: No, SCORE=0.50 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.95404 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, KAM_DMARC_QUARANTINE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2022 04:09:54 -0000 This is v2 of: https://sourceware.org/pipermail/gdb-patches/2022-January/185204.html The two changes are: - New patch 8: patch 7 fixes a bug gdbserver-side, which is good, but it then uncovers a small bug in gdb. Patch 8 fixes it. - Patch 8/8 in v1 (now 9/9) had a bug that broke some tests that detach the fork parent. Simon Marchi (9): gdb/infrun: add reason parameter to stop_all_threads gdb/linux-nat: remove check based on current_inferior in linux_handle_extended_wait gdb: replace inferior::waiting_for_vfork_done with inferior::thread_waiting_for_vfork_done gdb/infrun: add inferior parameters to stop_all_threads and restart_threads gdb/infrun: add logging statement to do_target_resume gdb: fix handling of vfork by multi-threaded program (follow-fork-mode=parent, detach-on-fork=on) gdbserver: report correct status in thread stop race condition gdb/remote: remove_new_fork_children don't access target_waitstatus::child_ptid if kind == TARGET_WAITKIND_THREAD_EXITED gdb: resume ongoing step after handling fork or vfork gdb/infcmd.c | 2 +- gdb/inferior.h | 8 +- gdb/infrun.c | 212 ++++++++++++++++-- gdb/infrun.h | 14 +- gdb/linux-nat.c | 17 +- gdb/remote.c | 7 +- .../gdb.threads/next-fork-other-thread.c | 86 +++++++ .../gdb.threads/next-fork-other-thread.exp | 116 ++++++++++ .../gdb.threads/vfork-multi-inferior-sleep.c | 25 +++ .../gdb.threads/vfork-multi-inferior.c | 55 +++++ .../gdb.threads/vfork-multi-inferior.exp | 115 ++++++++++ .../gdb.threads/vfork-multi-thread.c | 74 ++++++ .../gdb.threads/vfork-multi-thread.exp | 96 ++++++++ gdbserver/linux-low.cc | 60 +++-- 14 files changed, 806 insertions(+), 81 deletions(-) create mode 100644 gdb/testsuite/gdb.threads/next-fork-other-thread.c create mode 100644 gdb/testsuite/gdb.threads/next-fork-other-thread.exp create mode 100644 gdb/testsuite/gdb.threads/vfork-multi-inferior-sleep.c create mode 100644 gdb/testsuite/gdb.threads/vfork-multi-inferior.c create mode 100644 gdb/testsuite/gdb.threads/vfork-multi-inferior.exp create mode 100644 gdb/testsuite/gdb.threads/vfork-multi-thread.c create mode 100644 gdb/testsuite/gdb.threads/vfork-multi-thread.exp base-commit: e2c0149e8b0ce12accb8f4b02cbbeff3e91e4737 -- 2.34.1