From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1551) id 1DE003858D38; Mon, 7 Nov 2022 15:25:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1DE003858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667834747; bh=DZM3GrGfrK6NaZg0VcS0ht08a6jyf8SAJRJGhBZGwK8=; h=From:To:Subject:Date:From; b=jiZM8F6m/o3Z4wE5Vr8Nvs45UzNze8reOcu2OYN0/gQCrd6xjtdFJzitATD6WhGfO cTcxxUNbrNiNqS3dyw+UIkJ0ESfOA0yps2h+W9pW2wgkPjHUbjNNoRqWqolI+OludC VvkWtpPJA2shBy+Q9ZECRYERUvtnCP8DCCrzr/Mk= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pedro Alves To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Don't explicitly set clone child ptrace options X-Act-Checkin: binutils-gdb X-Git-Author: Pedro Alves X-Git-Refname: refs/heads/master X-Git-Oldrev: 23912acd402f5af9caf91b257e5209ec4c58a09c X-Git-Newrev: b7096df235486ce718c2a0bfda8a0db074dcb671 Message-Id: <20221107152547.1DE003858D38@sourceware.org> Date: Mon, 7 Nov 2022 15:25:35 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Db7096df23548= 6ce718c2a0bfda8a0db074dcb671 commit b7096df235486ce718c2a0bfda8a0db074dcb671 Author: Pedro Alves Date: Fri Oct 14 20:17:36 2022 +0100 Don't explicitly set clone child ptrace options =20 linux_handle_extended_wait calls target_post_attach if we're handling a PTRACE_EVENT_CLONE, and libthread_db.so isn't active. target_post_attach just calls linux_init_ptrace_procfs to set the lwp's ptrace options. However, this is completely unnecessary, because, as man ptrace [1] says, options are inherited: =20 "Flags are inherited by new tracees created and "auto-attached" via active PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK, or PTRACE_O_TRACECLO= NE options." =20 This removes the unnecessary call. =20 [1] - https://man7.org/linux/man-pages/man2/ptrace.2.html =20 Approved-By: Simon Marchi Change-Id: I533eaa60b700f7e40760311fc0d344d0b3f19a78 Diff: --- gdb/linux-nat.c | 1 - 1 file changed, 1 deletion(-) diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index f4f7aa81845..0b3c143382b 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -1912,7 +1912,6 @@ linux_handle_extended_wait (struct lwp_info *lp, int = status) { /* The process is not using thread_db. Add the LWP to GDB's list. */ - target_post_attach (new_lp->ptid.lwp ()); add_thread (linux_target, new_lp->ptid); }