From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5991 invoked by alias); 5 Feb 2009 15:55:02 -0000 Received: (qmail 5962 invoked by uid 22791); 5 Feb 2009 15:55:00 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Feb 2009 15:54:53 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n15Fsma0023340; Thu, 5 Feb 2009 10:54:48 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n15Fslma024860; Thu, 5 Feb 2009 10:54:48 -0500 Received: from opsy.redhat.com (vpn-14-114.rdu.redhat.com [10.11.14.114]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n15Fsk5D014951; Thu, 5 Feb 2009 10:54:47 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 724EF5080FB; Thu, 5 Feb 2009 08:54:44 -0700 (MST) To: Thiago Jung Bauermann Cc: Daniel Jacobowitz , gdb-patches ml Subject: Re: [RFA] Add la_getstr member to language_defn 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> From: Tom Tromey Reply-To: Tom Tromey Date: Thu, 05 Feb 2009 15:55:00 -0000 In-Reply-To: <1233785351.14735.56.camel@localhost.localdomain> (Thiago Jung Bauermann's message of "Wed\, 04 Feb 2009 20\:09\:11 -0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00122.txt.bz2 >>>>> "Thiago" == Thiago Jung Bauermann writes: Thiago> Right. Here's the new version. It also uses c_get_string for Ada and Thiago> minimal... Last night I thought of something else... 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... Thiago> +read_string (CORE_ADDR addr, int len, int width, unsigned int fetchlimit, [...] Thiago> + { /* Length of string is really 0! */ Thiago> + /* We always allocate *buffer. */ Thiago> + *buffer = bufptr = xmalloc (1); ... I think this code ought to allocate a buffer of WIDTH bytes, and set them all to 0. Tom