public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pedro Alves <palves@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Don't explicitly set clone child ptrace options
Date: Mon,  7 Nov 2022 15:25:35 +0000 (GMT)	[thread overview]
Message-ID: <20221107152547.1DE003858D38@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b7096df235486ce718c2a0bfda8a0db074dcb671

commit b7096df235486ce718c2a0bfda8a0db074dcb671
Author: Pedro Alves <pedro@palves.net>
Date:   Fri Oct 14 20:17:36 2022 +0100

    Don't explicitly set clone child ptrace options
    
    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:
    
      "Flags are inherited by new tracees created and "auto-attached" via
       active PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK, or PTRACE_O_TRACECLONE
       options."
    
    This removes the unnecessary call.
    
    [1] - https://man7.org/linux/man-pages/man2/ptrace.2.html
    
    Approved-By: Simon Marchi <simon.marchi@efficios.com>
    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);
 	    }

                 reply	other threads:[~2022-11-07 15:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221107152547.1DE003858D38@sourceware.org \
    --to=palves@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).