From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30591 invoked by alias); 4 Feb 2009 12:37:19 -0000 Received: (qmail 30577 invoked by uid 22791); 4 Feb 2009 12:37:17 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_56,SPF_PASS X-Spam-Check-By: sourceware.org Received: from e24smtp03.br.ibm.com (HELO e24smtp03.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Feb 2009 12:37:10 +0000 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by e24smtp03.br.ibm.com (8.13.1/8.13.1) with ESMTP id n14CZrc0018823 for ; Wed, 4 Feb 2009 10:35:53 -0200 Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.18.232.47]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id n14DaY9V3010614 for ; Wed, 4 Feb 2009 10:36:34 -0300 Received: from d24av02.br.ibm.com (loopback [127.0.0.1]) by d24av02.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n14Cb5BM016229 for ; Wed, 4 Feb 2009 10:37:06 -0200 Received: from [9.8.15.88] ([9.8.15.88]) by d24av02.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n14Cb44q016215; Wed, 4 Feb 2009 10:37:04 -0200 Subject: Re: [RFA] Add la_getstr member to language_defn From: Thiago Jung Bauermann To: Tom Tromey Cc: Daniel Jacobowitz , gdb-patches ml In-Reply-To: References: <1227417278.28256.183.camel@localhost.localdomain> <20081123161013.GA15069@caradoc.them.org> <1227490821.8533.25.camel@hotblack.bauerhaus> <20081124022858.GA19331@caradoc.them.org> <1227551659.28256.225.camel@localhost.localdomain> <20081124202146.GA1991@caradoc.them.org> <1227564549.28256.248.camel@localhost.localdomain> <1230949603.8380.143.camel@localhost.localdomain> <1233665501.14735.7.camel@localhost.localdomain> Content-Type: text/plain; charset=utf-8 Date: Wed, 04 Feb 2009 12:37:00 -0000 Message-Id: <1233751023.14735.40.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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: 2009-02/txt/msg00090.txt.bz2 El mar, 03-02-2009 a las 10:44 -0700, Tom Tromey escribió: > >>>>> "Thiago" == Thiago Jung Bauermann writes: > > Tom> When would we want the latter behavior? I think perhaps la_getstr > Tom> should simply have 'void' type and then call error if read_string > Tom> returns an error. > > [...] > > Thiago> I don't have a strong preference. The function could always throw an > Thiago> exception on error, and the caller would then check LENGTH to see if > Thiago> something was read. I can change it to do so if you prefer it that way. > > When would a caller want to use a partial result? If there is a case > where we'd want that, then the current approach used in the patch > seems ok. However, if there is no case where we'd want to do that, > then this approach is more complex without a benefit. > > The reason I ask is that I noticed that the only caller of this > function -- the new Value.string method -- discards a partial result. You're worried about complexity in the code for c_get_string, or its callers? The former is not a problem because we get this behaviour for free from read_string, which is also called by val_print_string. This function uses a partial result. -- []'s Thiago Jung Bauermann IBM Linux Technology Center