From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15408 invoked by alias); 11 Jan 2013 14:49:24 -0000 Received: (qmail 15373 invoked by uid 22791); 11 Jan 2013 14:49:21 -0000 X-SWARE-Spam-Status: No, hits=-7.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Jan 2013 14:49:09 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0BEn7UO028635 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 11 Jan 2013 09:49:07 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0BEn5Ef014024; Fri, 11 Jan 2013 09:49:06 -0500 Message-ID: <50F02661.8020400@redhat.com> Date: Fri, 11 Jan 2013 14:49:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Sergio Durigan Junior CC: Jan Kratochvil , GDB Patches , Binutils Development , "H.J. Lu" Subject: Re: [PATCH/RFC 02/02 v2] Refactor PRPSINFO handling on GDB References: <20121218171555.GA19639@host2.jankratochvil.net> <20121231194134.GA17955@host2.jankratochvil.net> <50EF0BE3.6040503@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2013-01/txt/msg00221.txt.bz2 On 01/11/2013 03:53 AM, Sergio Durigan Junior wrote: > Anyway, at first I thought that the extension could be seen as > refactoring as well, that's why I didn't bother making another patch. http://en.wikipedia.org/wiki/Code_refactoring "Code refactoring is a \"disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior\", undertaken in order to improve some of the nonfunctional attributes of the software. " ;-) > >>> + /* Generating and copying the program's arguments. `get_inferior_args' >>> + may throw, but we want to continue the execution anyway. */ >>> + TRY_CATCH (ex, RETURN_MASK_ERROR) >>> + { >>> + infargs = get_inferior_args (); >>> + } >>> + >> >> Hmm? We were not doing that before. What exception is that? > > `get_inferior_args' calls `construct_inferior_arguments', which can call > `error' in an specific scenario (not STARTUP_WITH_SHELL, arguments that > contain spaces). This is an example of something that should be split into its own change, along with its own rationale. This is independent of any refactoring of PRPSINFO handling. We're already calling get_inferior_args nowadays, and I don't ever remember this error being reported as a problem. The reason must be that STARTUP_WITH_SHELL is always defined to 1 nowadays. It hasn't been zapped because it'd actually be nice to make it a user setting. And once that is done, we'd indeed trip on that error. In any case, it seems to me that that error/exception/limitation could/should be lifted by making construct_inferior_arguments quote the arguments with spaces. -- Pedro Alves