From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6379 invoked by alias); 20 Sep 2012 21:43:59 -0000 Received: (qmail 6367 invoked by uid 22791); 20 Sep 2012 21:43:58 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO,TW_TX X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Sep 2012 21:43:44 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 31C1B1C7CE9; Thu, 20 Sep 2012 17:43:43 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id FOMHETUu-LcR; Thu, 20 Sep 2012 17:43:43 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E80561C7CE3; Thu, 20 Sep 2012 17:43:42 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 73BDECBBAD; Thu, 20 Sep 2012 14:43:40 -0700 (PDT) Date: Thu, 20 Sep 2012 21:43:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 4/4] Delete unused functions in sol-thread.c. Message-ID: <20120920214340.GB5423@adacore.com> References: <1348158841-2313-1-git-send-email-brobecker@adacore.com> <1348158841-2313-5-git-send-email-brobecker@adacore.com> <505B52EA.5080908@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="mP3DRpeJDSE+ciuQ" Content-Disposition: inline In-Reply-To: <505B52EA.5080908@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-09/txt/msg00414.txt.bz2 --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1409 > Can you expand on what "unused" means? Good question! > The Solaris man page I peeked at says these functions are SPARC only. > Does this mean that current SPARC Solaris libthread_db doesn't call them > after all? What about older versions? It took me a while to investigate this part because our sparc-solaris machines are just sooooo sloooooowwww. Initially, I thought it might have been something related to OS versions, but the answer was right there in front of me, if I had tested the patch on *sparc* solaris (in addition to *x86* solaris). Basically, /usr/include/proc_service.h: #if defined(__sparc) || defined(__sparcv9) extern ps_err_e ps_lgetxregsize(struct ps_prochandle *, lwpid_t, int *); extern ps_err_e ps_lgetxregs(struct ps_prochandle *, lwpid_t, caddr_t); extern ps_err_e ps_lsetxregs(struct ps_prochandle *, lwpid_t, caddr_t); #endif In other words, these routines are used on sparc-solaris, while they are not expected on x86-solaris. I propose we start with the following patch (0001-[...].patch), and while at it, we remove all the commented out code (0002-[...]). This is a stop-gap measure to allow the build to work with -Werror on x86-solaris. And the next step I propose, to finish the work, is to move these functions to their own file (sol-sparc-thread.c). We would then only build that file for sparc-solaris native GDB. WDYT? Thanks, -- Joel --mP3DRpeJDSE+ciuQ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-sol-thread.c-conditionalize-some-sparc-specific-libt.patch" Content-length: 1052 >From 01b5ab3a4c11703220543e16e21f140f2eaf33e2 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 20 Sep 2012 17:28:01 -0400 Subject: [PATCH 1/2] sol-thread.c: conditionalize some sparc-specific libthread_db functions. gdb/ChangeLog: * sol-thread.c (ps_lgetxregsize, ps_lgetxregs, ps_lsetxregs): Enable this code for sparc hosts only. --- gdb/sol-thread.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 78dcec3..323a122 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -984,6 +984,8 @@ ps_plog (const char *fmt, ...) vfprintf_filtered (gdb_stderr, fmt, args); } +#if defined(__sparc) || defined(__sparcv9) + /* Get size of extra register set. Currently a noop. */ ps_err_e @@ -1058,6 +1060,8 @@ ps_lsetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset) return PS_OK; } +#endif /* defined(__sparc) || defined(__sparcv9) */ + /* Get floating-point registers for LWP. */ ps_err_e -- 1.7.0.4 --mP3DRpeJDSE+ciuQ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0002-sol-thread.c-Remove-if-0-ed-code.patch" Content-length: 2144 >From 5ecc0d7df0ea8f2d53304326147a2a82220de2e8 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 20 Sep 2012 17:29:35 -0400 Subject: [PATCH 2/2] sol-thread.c: Remove #if 0-ed code. gdb/ChangeLog: * sol-thread.c (ps_lgetxregsize, ps_lgetxregs, ps_lsetxregs): Remove commented-out code. --- gdb/sol-thread.c | 50 -------------------------------------------------- 1 files changed, 0 insertions(+), 50 deletions(-) diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 323a122..b86079f 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -991,26 +991,6 @@ ps_plog (const char *fmt, ...) ps_err_e ps_lgetxregsize (gdb_ps_prochandle_t ph, lwpid_t lwpid, int *xregsize) { -#if 0 - int lwp_fd; - int regsize; - ps_err_e val; - - val = get_lwp_fd (ph, lwpid, &lwp_fd); - if (val != PS_OK) - return val; - - if (ioctl (lwp_fd, PIOCGXREGSIZE, ®size)) - { - if (errno == EINVAL) - return PS_NOFREGS; /* XXX Wrong code, but this is the closest - thing in proc_service.h */ - - print_sys_errmsg ("ps_lgetxregsize (): PIOCGXREGSIZE", errno); - return PS_ERR; - } -#endif - return PS_OK; } @@ -1019,21 +999,6 @@ ps_lgetxregsize (gdb_ps_prochandle_t ph, lwpid_t lwpid, int *xregsize) ps_err_e ps_lgetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset) { -#if 0 - int lwp_fd; - ps_err_e val; - - val = get_lwp_fd (ph, lwpid, &lwp_fd); - if (val != PS_OK) - return val; - - if (ioctl (lwp_fd, PIOCGXREG, xregset)) - { - print_sys_errmsg ("ps_lgetxregs (): PIOCGXREG", errno); - return PS_ERR; - } -#endif - return PS_OK; } @@ -1042,21 +1007,6 @@ ps_lgetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset) ps_err_e ps_lsetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset) { -#if 0 - int lwp_fd; - ps_err_e val; - - val = get_lwp_fd (ph, lwpid, &lwp_fd); - if (val != PS_OK) - return val; - - if (ioctl (lwp_fd, PIOCSXREG, xregset)) - { - print_sys_errmsg ("ps_lsetxregs (): PIOCSXREG", errno); - return PS_ERR; - } -#endif - return PS_OK; } -- 1.7.0.4 --mP3DRpeJDSE+ciuQ--