From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2580 invoked by alias); 24 Nov 2008 18:51:32 -0000 Received: (qmail 2517 invoked by uid 22791); 24 Nov 2008 18:51:31 -0000 X-Spam-Check-By: sourceware.org Received: from igw2.br.ibm.com (HELO igw2.br.ibm.com) (32.104.18.25) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Nov 2008 18:50:48 +0000 Received: from d24relay01.br.ibm.com (unknown [9.8.31.16]) by igw2.br.ibm.com (Postfix) with ESMTP id 2E05517F631 for ; Mon, 24 Nov 2008 15:34:27 -0200 (BRDT) 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 mAOJoDZW3739698 for ; Mon, 24 Nov 2008 16:50:13 -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 mAOIobSY013172 for ; Mon, 24 Nov 2008 16:50:37 -0200 Received: from [9.8.7.183] ([9.8.7.183]) by d24av02.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id mAOIoanS013127; Mon, 24 Nov 2008 16:50:36 -0200 Subject: Re: [RFA] Add la_getstr member to language_defn From: Thiago Jung Bauermann To: tromey@redhat.com Cc: gdb-patches ml In-Reply-To: References: <1227417278.28256.183.camel@localhost.localdomain> Content-Type: text/plain; charset=utf-8 Date: Mon, 24 Nov 2008 21:19:00 -0000 Message-Id: <1227552637.28256.231.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: 2008-11/txt/msg00655.txt.bz2 El lun, 24-11-2008 a las 09:44 -0700, Tom Tromey escribió: > Thiago> * language.h (language_dfn): Add la_getstr member. > Thiago> (LA_GET_STRING): New macro. > > A nit: the macro is called LA_GET_STRING, but the field is la_getstr. > How about la_get_string for the field instead? I was just following the la_printstr/LA_PRINT_STRING example. I agree la_get_string is better. Since there doesn't seem to be a strict pattern for these names, I'll make the change. > Thiago> + int (*la_getstr) (struct value *value, gdb_byte **buffer, int *length); > > I was thinking about writing this function for Java, sort of as a > proof of the API. One oddity here is that a String there has a fixed > encoding, which may or may not be the same as the target charset (and > in any case, is not convertible using the charset.c code). > > One idea for fixing this is to let this new method optionally return > an encoding. That way a language implementation could fill in this > info if it is known. The C implementation would simply do nothing > here. > > What do you think? I'm fine with that. What about adding a const char **encoding argument? c_getstr could return the value from target_charset. -- []'s Thiago Jung Bauermann IBM Linux Technology Center