From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23451 invoked by alias); 2 Oct 2013 09:30:32 -0000 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 Received: (qmail 23438 invoked by uid 89); 2 Oct 2013 09:30:31 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 Oct 2013 09:30:31 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r929UTKN031980 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Oct 2013 05:30:29 -0400 Received: from localhost.localdomain (ovpn-112-22.ams2.redhat.com [10.36.112.22]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r929URK3016165; Wed, 2 Oct 2013 05:30:28 -0400 Message-ID: <524BE7B3.3030805@redhat.com> Date: Wed, 02 Oct 2013 09:30:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: Tom Tromey CC: "gdb-patches@sourceware.org" Subject: Re: [patch][python] Fix python/14513 References: <5239A7E9.8010202@redhat.com> <877gedub9p.fsf@fleche.redhat.com> <523A0E4E.3090105@redhat.com> <8738p1uam6.fsf@fleche.redhat.com> In-Reply-To: <8738p1uam6.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00086.txt.bz2 On 18/09/13 21:40, Tom Tromey wrote: >>>>>> "Phil" == Phil Muldoon writes: > > Phil> If you look at the testsuite for py-param, they do have this option. > > Oh right! I forgot about that, sorry. > > Phil> What do you think? > > Ugh. Well, while we don't actually promise to print anything, it seems > weird to require a string result just to throw it away. How about we > remove the "else" clause and not print anything at all if the > get_set_string method is not implemented? This ought to clean up most > uses. I think you mean the else clause in the py-param.c code? If so, we cannot remove it as it preserves < 7.3 API: else { /* We have to preserve the existing < GDB 7.3 API. If a callback function does not exist, then attempt to read the set_doc attribute. */ set_doc_string = get_doc_string (obj, set_doc_cst); } I am not sure what the resolution is here. At some point we have to decide whether we have anything valid to print. We can hoist the fprint into both of these branches, but even in the "else" clause we have to check if we actually have anything as the fprint adds a newline to the set documentation: fprintf_filtered (gdb_stdout, "%s\n", set_doc_string); What are your thoughts on this? Cheers, Phil