From patchwork Wed Sep 27 08:43:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 23171 Received: (qmail 44768 invoked by alias); 27 Sep 2017 08:44:05 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 44753 invoked by uid 89); 27 Sep 2017 08:44:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-19.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Solutions, Johns, johns, 1999-2017 X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Sep 2017 08:44:02 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 2D829195; Wed, 27 Sep 2017 10:44:00 +0200 (CEST) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id UEDAXzObTlxn; Wed, 27 Sep 2017 10:43:56 +0200 (CEST) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 7F7F3194; Wed, 27 Sep 2017 10:43:56 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id v8R8htai014654; Wed, 27 Sep 2017 10:43:55 +0200 (MEST) From: Rainer Orth To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: Remove ioctl-based procfs support on Solaris References: <7af9e9eb-62cd-ce53-173b-a12c3d6c0bd5@redhat.com> Date: Wed, 27 Sep 2017 10:43:55 +0200 In-Reply-To: <7af9e9eb-62cd-ce53-173b-a12c3d6c0bd5@redhat.com> (Pedro Alves's message of "Tue, 26 Sep 2017 15:03:21 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 Hi Pedro, > This all looks good to me FWIW, with a couple tiny nits below. > >> /proc file system, which is used on many versions of Unix >> as a means for debuggers to control other processes. > > Could you update this comment in procfs.c to mention Solaris > explicitly, please? Likewise the first line of the file. done, as well as in the Solaris-only proc-*.c files. >> - Examples of the systems that use this interface are: >> - >> - Irix >> - Solaris >> - OSF >> - AIX5 > > ... > >> - There are three methods for doing this function: >> - 1) Newest: read/write [PCSET/PCRESET/PCUNSET] >> - [Sol6, Sol7, UW] >> - 2) Middle: PIOCSET/PIOCRESET >> - [Irix, Sol5] >> - 3) Oldest: PIOCSFORK/PIOCRFORK/PIOCSRLC/PIOCRRLC >> - [OSF, Sol5] >> - >> - Note: Irix does not define PR_ASYNC. >> - Note: OSF does not define PR_KLC. >> - Note: OSF is the only one that can ONLY use the oldest method. >> + This function is done using read/write [PCSET/PCRESET/PCUNSET] [Sol6, >> Sol7]. > > I think the "[Sol6, Sol7]" above referred to Solaris 2.6-7. > Should we remove that? Certainly: this was used to refer to structured procfs, I believe. The following patch on top of the previous one should address all this, and John's comment as well. Rainer diff --git a/gdb/common/common.m4 b/gdb/common/common.m4 --- a/gdb/common/common.m4 +++ b/gdb/common/common.m4 @@ -26,7 +26,7 @@ AC_DEFUN([GDB_AC_COMMON], [ AM_LANGINFO_CODESET AC_CHECK_HEADERS(linux/perf_event.h locale.h memory.h signal.h dnl - sys/resource.h sys/socket.h sys/syscall.h dnl + sys/resource.h sys/socket.h dnl sys/un.h sys/wait.h dnl thread_db.h wait.h dnl termios.h termio.h sgtty.h) diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1289,6 +1289,11 @@ AC_CHECK_HEADERS([nlist.h machine/reg.h termios.h termio.h \ sgtty.h elf_hp.h \ dlfcn.h]) +AC_CHECK_HEADERS(sys/user.h, [], [], +[#if HAVE_SYS_PARAM_H +# include +#endif +]) AC_CHECK_HEADERS(curses.h cursesX.h ncurses.h ncurses/ncurses.h ncurses/term.h) AC_CHECK_HEADERS(term.h, [], [], diff --git a/gdb/proc-api.c b/gdb/proc-api.c --- a/gdb/proc-api.c +++ b/gdb/proc-api.c @@ -1,4 +1,4 @@ -/* Machine independent support for SVR4 /proc (process file system) for GDB. +/* Machine independent support for Solaris /proc (process file system) for GDB. Copyright (C) 1999-2017 Free Software Foundation, Inc. diff --git a/gdb/proc-events.c b/gdb/proc-events.c --- a/gdb/proc-events.c +++ b/gdb/proc-events.c @@ -1,4 +1,4 @@ -/* Machine-independent support for SVR4 /proc (process file system) +/* Machine-independent support for Solaris /proc (process file system) Copyright (C) 1999-2017 Free Software Foundation, Inc. diff --git a/gdb/proc-flags.c b/gdb/proc-flags.c --- a/gdb/proc-flags.c +++ b/gdb/proc-flags.c @@ -1,4 +1,4 @@ -/* Machine independent support for SVR4 /proc (process file system) for GDB. +/* Machine independent support for Solaris /proc (process file system) for GDB. Copyright (C) 1999-2017 Free Software Foundation, Inc. Written by Michael Snyder at Cygnus Solutions. Based on work by Fred Fish, Stu Grossman, Geoff Noer, and others. diff --git a/gdb/proc-why.c b/gdb/proc-why.c --- a/gdb/proc-why.c +++ b/gdb/proc-why.c @@ -1,4 +1,4 @@ -/* Machine-independent support for SVR4 /proc (process file system) +/* Machine-independent support for Solaris /proc (process file system) Copyright (C) 1999-2017 Free Software Foundation, Inc. diff --git a/gdb/procfs.c b/gdb/procfs.c --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -1,4 +1,4 @@ -/* Machine independent support for SVR4 /proc (process file system) for GDB. +/* Machine independent support for Solaris /proc (process file system) for GDB. Copyright (C) 1999-2017 Free Software Foundation, Inc. @@ -62,7 +62,8 @@ One that uses the ioctl system call, and another that uses read and write system calls. - This module supports only the read/write interface. */ + This module supports only the Solaris version of the read/write + interface. */ #include #include /* opendir/readdir, for listing the LWP's */ @@ -768,7 +769,7 @@ proc_sysargs (procinfo *pi) PR_KLC -- traced process is killed when last /proc file closed. PR_ASYNC -- LWP's get to run/stop independently. - This function is done using read/write [PCSET/PCRESET/PCUNSET] [Sol6, Sol7]. + This function is done using read/write [PCSET/PCRESET/PCUNSET]. Arguments: pi -- the procinfo