From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10546 invoked by alias); 5 Feb 2009 16:33:22 -0000 Received: (qmail 10537 invoked by uid 22791); 5 Feb 2009 16:33:22 -0000 X-SWARE-Spam-Status: No, hits=-2.7 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; Thu, 05 Feb 2009 16:33:14 +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 n15GcpM5015664 for ; Thu, 5 Feb 2009 14:38:51 -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 n15HWdGu3764410 for ; Thu, 5 Feb 2009 14:32:39 -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 n15GXAGX016851 for ; Thu, 5 Feb 2009 14:33:11 -0200 Received: from [9.18.201.230] ([9.18.201.230]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n15GXAn5016846; Thu, 5 Feb 2009 14:33:10 -0200 Subject: RE: [RFA] Add la_getstr member to language_defn From: Thiago Jung Bauermann To: Pierre Muller Cc: "'Tom Tromey'" , "'Daniel Jacobowitz'" , "'gdb-patches ml'" In-Reply-To: <000401c987ab$bc52a520$34f7ef60$@u-strasbg.fr> 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> <1233751023.14735.40.camel@localhost.localdomain> <1233785351.14735.56.camel@localhost.localdomain> <000401c987ab$bc52a520$34f7ef60$@u-strasbg.fr> Content-Type: text/plain; charset=utf-8 Date: Thu, 05 Feb 2009 16:33:00 -0000 Message-Id: <1233851589.14735.82.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/msg00127.txt.bz2 El jue, 05-02-2009 a las 17:06 +0100, Pierre Muller escribió: > > Thiago> + Assumes strings are terminated by a null character. > > [...] > > Thiago> +void > > Thiago> +c_get_string (struct value *value, gdb_byte **buffer, int > > *length, > > Thiago> + const char **charset) > > > > My understanding is that the contract for la_getstr says that the > > resulting string will be zero-terminated. But if that is the case... > > But this would also mean that the string could not contain > zero in the middle, which sometimes happens for pascal strings... > > Isn't the length argument there for this? Right. The contract (the comment above la_get_string in language_defn, assuming it is legally binding :-) ) doesn't say that the string should be null-terminated. And the length argument doesn't count the ending null character, should it be present. -- []'s Thiago Jung Bauermann IBM Linux Technology Center