From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19317 invoked by alias); 1 Feb 2002 17:39:20 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 19248 invoked from network); 1 Feb 2002 17:39:15 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 1 Feb 2002 17:39:15 -0000 Received: from telocity.telocity.com (taarna.sfbay.redhat.com [205.180.230.102]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with SMTP id JAA16835; Fri, 1 Feb 2002 09:39:02 -0800 (PST) Message-ID: <3C5AD1A6.868@redhat.com> Date: Fri, 01 Feb 2002 09:39:00 -0000 From: Michael Snyder X-Mailer: Mozilla 3.04 (Win95; I) MIME-Version: 1.0 To: rbrown64@csc.com.au CC: gdb-patches@sources.redhat.com Subject: Re: RFA/Patch Solaris /proc configury References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-02/txt/msg00006.txt.bz2 rbrown64@csc.com.au wrote: > > This patch is the beginnings of what is required to switch > sparc-sun-solaris2.[6-8] to using the `new structured /proc definitions'. > => pstatus_t interface. On Solaris 2.[78], pstatus_t has the pr_dmodel > member which defines whether the process data model is ILP32 or LP64 > - identifying 64-bit processes? Hi Rodney, Is there a reason for making this change? Doesn't everything work the way it is? What do we gain? Thanks, Michael > > If applied it will break Solaris 2.[6-8]. Including > instead of without #defining _STRUCTURED_PROC=1 > will expose the old prstatus_t interface. > Were I not trying to keep this as a minor change (Corporate assignment), > fiddling the 36 files in gdb/ to #include "procfs.h" > instead of where gdb/procfs.h holds > #if defined(HAVE_PROCFS_H) > #include > #elif defined(HAVE_SYS_PROCFS_H) > #include > #endif > should make things build on Solaris 2.[6-8] again. > > It also checks for prstatus_t in gdb/configure.in. > This should allow wrapping the elfcore_write_{prfpreg,prpsinfo} calls > in gdb/procfs.c with > #if defined(HAVE_PRSTATUS_T) || defined(HAVE_PSTATUS_T) > #endif > to make it possible to link on alpha*-dec-osf4* again. > Though maybe it would be better to explictly check for each of the > elfcore_write structures and #ifdef appropriately. > > Comments? > > Maybe a less disruptive change would be to check for pr_dmodel in > pstatus_t if exists and #define _STRUCTURED_PROC=1 > only if it is found, updating config.h to set _STRUCTURED_PROC > and undefining HAVE_PROCFS_H. > > 2002-02-01 Rodney Brown > > * bfd/acinclude.m4(BFD_HAVE_SYS_PROCFS_TYPE): Use HAVE_PROCFS_H. > (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise. > * bfd/configure.in: Check procfs.h. Check pr_dmodel in pstatus_t. > * gdb/configure.in: Check procfs.h. Check pr_dmodel in pstatus_t. > Check prstatus_t. > (gdb_cv_prfpregset_t_broken): Use HAVE_PROCFS_H. > (gdb_cv_have_procfs_piocset): Use HAVE_PROCFS_H. > > --- bfd/acinclude.m4.orig Thu Aug 31 20:35:50 2000 > +++ bfd/acinclude.m4 Fri Feb 1 20:40:06 2002 > @@ -69,14 +69,18 @@ > fi > ])dnl > > -dnl Check for existence of a type $1 in sys/procfs.h > +dnl Check for existence of a type $1 in procfs.h or sys/procfs.h > > AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE, > [AC_MSG_CHECKING([for $1 in sys/procfs.h]) > AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1, > [AC_TRY_COMPILE([ > #define _SYSCALL32 > -#include ], > +#ifdef HAVE_PROCFS_H > +#include > +#else > +#include > +#endif], > [$1 avar], > bfd_cv_have_sys_procfs_type_$1=yes, > bfd_cv_have_sys_procfs_type_$1=no > @@ -89,14 +93,18 @@ > ]) > > -dnl Check for existence of member $2 in type $1 in sys/procfs.h > +dnl Check for existence of member $2 in type $1 in procfs.h or sys/procfs.h > > AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER, > [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h]) > AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2, > [AC_TRY_COMPILE([ > #define _SYSCALL32 > -#include ], > +#ifdef HAVE_PROCFS_H > +#include > +#else > +#include > +#endif], > [$1 avar; void* aref = (void*) &avar.$2], > bfd_cv_have_sys_procfs_type_member_$1_$2=yes, > bfd_cv_have_sys_procfs_type_member_$1_$2=no > --- bfd/configure.in.orig Thu Jan 24 13:32:30 2002 > +++ bfd/configure.in Thu Jan 31 23:27:46 2002 > @@ -376,13 +376,15 @@ > > # ELF corefile support has several flavors, but all of > # them use something called > - AC_CHECK_HEADERS(sys/procfs.h) > - if test "$ac_cv_header_sys_procfs_h" = yes; then > + AC_CHECK_HEADERS(procfs.h sys/procfs.h) > + if test "$ac_cv_header_procfs_h" = yes -o "$ac_cv_header_sys_procfs_h" = yes > + then > BFD_HAVE_SYS_PROCFS_TYPE(prstatus_t) > BFD_HAVE_SYS_PROCFS_TYPE(prstatus32_t) > BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus_t, pr_who) > BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus32_t, pr_who) > BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t) > + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(pstatus_t, pr_dmodel) > BFD_HAVE_SYS_PROCFS_TYPE(pxstatus_t) > BFD_HAVE_SYS_PROCFS_TYPE(pstatus32_t) > BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo_t) > --- gdb/configure.in.orig Mon Jan 21 05:19:30 2002 > +++ gdb/configure.in Fri Feb 1 15:36:59 2002 > @@ -119,7 +119,7 @@ > esac; esac > > AC_CHECK_HEADERS(ctype.h nlist.h link.h thread_db.h proc_service.h \ > - memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \ > + memory.h objlist.h procfs.h ptrace.h sgtty.h stddef.h stdlib.h \ > string.h sys/procfs.h sys/ptrace.h sys/reg.h stdint.h \ > term.h termio.h termios.h unistd.h wait.h sys/wait.h \ > wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \ > @@ -285,8 +285,11 @@ > esac > fi > > -if test "$ac_cv_header_sys_procfs_h" = yes; then > +if test "$ac_cv_header_procfs_h" = yes -o "$ac_cv_header_sys_procfs_h" = yes > +then > + BFD_HAVE_SYS_PROCFS_TYPE(prstatus_t) > BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t) > + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(pstatus_t, pr_dmodel) > BFD_HAVE_SYS_PROCFS_TYPE(prrun_t) > BFD_HAVE_SYS_PROCFS_TYPE(gregset_t) > BFD_HAVE_SYS_PROCFS_TYPE(fpregset_t) > @@ -312,7 +315,12 @@ > if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then > AC_MSG_CHECKING(whether prfpregset_t type is broken) > AC_CACHE_VAL(gdb_cv_prfpregset_t_broken, > - [AC_TRY_RUN([#include > + [AC_TRY_RUN([ > +#ifdef HAVE_PROCFS_H > +#include > +#else > +#include > +#endif > int main () > { > if (sizeof (prfpregset_t) == sizeof (void *)) > @@ -334,7 +342,11 @@ > AC_CACHE_VAL(gdb_cv_have_procfs_piocset, > [AC_TRY_COMPILE([#include > #include > +#ifdef HAVE_PROCFS_H > +#include > +#else > #include > +#endif > ], [ > int dummy;; > dummy = ioctl(0, PIOCSET, &dummy);