From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6963 invoked by alias); 3 Feb 2009 12:51:56 -0000 Received: (qmail 6955 invoked by uid 22791); 3 Feb 2009 12:51:56 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from e24smtp01.br.ibm.com (HELO e24smtp01.br.ibm.com) (32.104.18.85) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Feb 2009 12:51:51 +0000 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by e24smtp01.br.ibm.com (8.13.1/8.13.1) with ESMTP id n13CvBtJ009010 for ; Tue, 3 Feb 2009 10:57:11 -0200 Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id n13DpGW93240076 for ; Tue, 3 Feb 2009 10:51:16 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n13Cpj9d031502 for ; Tue, 3 Feb 2009 10:51:47 -0200 Received: from [9.8.5.242] ([9.8.5.242]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n13CphWH031401; Tue, 3 Feb 2009 10:51:45 -0200 Subject: Re: [RFA] Add la_getstr member to language_defn From: Thiago Jung Bauermann To: tromey@redhat.com 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> Content-Type: text/plain; charset=utf-8 Date: Tue, 03 Feb 2009 12:51:00 -0000 Message-Id: <1233665501.14735.7.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/msg00054.txt.bz2 El lun, 02-02-2009 a las 11:41 -0700, Tom Tromey escribió: > >>>>> "Thiago" == Thiago Jung Bauermann writes: > > [ la_getstr ] > Thiago> The patch doesn't apply anymore. This is the same patch, refreshed > Thiago> against HEAD as of Dec 28th. > > Thiago> + Return 0 on success, errno on failure. */ > Thiago> + > Thiago> +static int > Thiago> +c_get_string (struct value *value, gdb_byte **buffer, int *length, > Thiago> + const char **charset) > > The return value here is a bit funny. For some errors this function > calls error, but for others it returns the result of read_string. > > When would we want the latter behavior? I think perhaps la_getstr > should simply have 'void' type and then call error if read_string > returns an error. The function throws an exception when it can't even start to read a string, and returns an error when it may have already read something, but hit an error halfway through. > What do you think? I don't have a strong preference. The function could always throw an exception on error, and the caller would then check LENGTH to see if something was read. I can change it to do so if you prefer it that way. -- []'s Thiago Jung Bauermann IBM Linux Technology Center