From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by sourceware.org (Postfix) with ESMTP id 2DD0339450E2 for ; Tue, 17 Mar 2020 15:47:27 +0000 (GMT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-378-JZ1pCHvdMbmzX0yrq15hwg-1; Tue, 17 Mar 2020 11:47:25 -0400 X-MC-Unique: JZ1pCHvdMbmzX0yrq15hwg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5EE04A1360; Tue, 17 Mar 2020 15:47:24 +0000 (UTC) Received: from psique.yyz.redhat.com (unused-10-15-17-54.yyz.redhat.com [10.15.17.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44C3C10027A7; Tue, 17 Mar 2020 15:47:21 +0000 (UTC) From: Sergio Durigan Junior To: GDB Patches Cc: Pedro Alves , Tom Tromey , Kevin Buettner , Sergio Durigan Junior Subject: [PATCH v2 0/5] Improve ptrace-error detection Date: Tue, 17 Mar 2020 11:47:14 -0400 Message-Id: <20200317154719.2078283-1-sergiodj@redhat.com> In-Reply-To: <20200226200542.746617-1-sergiodj@redhat.com> References: <20200226200542.746617-1-sergiodj@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 17 Mar 2020 15:47:28 -0000 Changes from v1: - Remove "config.h" include from scoped_pipe.h. - Remove "explicit" keyword from scoped_pipe's constructor. - Use "GDBSUPPORT" instead of "COMMON" as a prefix for #define on scoped_pipe.h. - Remove errno save/restore dance from gdbserver/utils.cc:perror_with_name. - Implement "ptrace_attach" vs. "attach" idea (from Pedro) on inf-ptrace.c in order to make sure we return ptrace errno when calling "attach". Sergio Durigan Junior (5): Introduce scoped_pipe.h Don't reset errno/bfd_error on 'throw_perror_with_name' Expand 'fork_inferior' to check whether 'traceme_fun' succeeded Extend GNU/Linux to check for ptrace error Document Linux-specific possible ptrace restrictions gdb/Makefile.in | 1 + gdb/doc/gdb.texinfo | 136 +++++++++++++++ gdb/inf-ptrace.c | 34 +++- gdb/inf-ptrace.h | 2 + gdb/linux-nat.c | 24 +-- gdb/nat/fork-inferior.c | 231 ++++++++++++++++++++++++-- gdb/nat/fork-inferior.h | 87 ++++++++-- gdb/nat/linux-ptrace.c | 178 +++++++++++++++++++- gdb/nat/linux-ptrace.h | 27 ++- gdb/remote.c | 40 ++++- gdb/unittests/scoped_pipe-selftests.c | 95 +++++++++++ gdb/utils.c | 6 - gdbserver/linux-low.cc | 31 +++- gdbserver/server.cc | 38 ++++- gdbserver/thread-db.cc | 2 +- gdbsupport/scoped_pipe.h | 63 +++++++ 16 files changed, 918 insertions(+), 77 deletions(-) create mode 100644 gdb/unittests/scoped_pipe-selftests.c create mode 100644 gdbsupport/scoped_pipe.h --=20 2.24.1