From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31030 invoked by alias); 24 Nov 2008 02:30:00 -0000 Received: (qmail 30990 invoked by uid 22791); 24 Nov 2008 02:29:59 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Nov 2008 02:29:09 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id B2BC01059A; Mon, 24 Nov 2008 02:28:59 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 92CA8104A1; Mon, 24 Nov 2008 02:28:59 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1L4RC6-0005AN-Dn; Sun, 23 Nov 2008 21:28:58 -0500 Date: Mon, 24 Nov 2008 16:19:00 -0000 From: Daniel Jacobowitz To: Thiago Jung Bauermann Cc: gdb-patches ml Subject: Re: [RFA] Add la_getstr member to language_defn Message-ID: <20081124022858.GA19331@caradoc.them.org> Mail-Followup-To: Thiago Jung Bauermann , gdb-patches ml References: <1227417278.28256.183.camel@localhost.localdomain> <20081123161013.GA15069@caradoc.them.org> <1227490821.8533.25.camel@hotblack.bauerhaus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1227490821.8533.25.camel@hotblack.bauerhaus> User-Agent: Mutt/1.5.17 (2008-05-11) 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/msg00631.txt.bz2 On Sun, Nov 23, 2008 at 11:40:21PM -0200, Thiago Jung Bauermann wrote: > The comment is wrong. c_getstr actually reads until a null character is > found, but doesn't read past the end of an array with known length. I > updated the comment to reflect that. > > Except that there was a bug for GDB-hosted strings, in which case the > function behaved as described by the comment. I fixed it now. Are you sure? I took a look at read_string and its comments and it seemed to do what I described - but I might be wrong. + If LEN is -1, stops at the first null character (not necessarily the first + null byte) up to a maximum of FETCHLIMIT characters, otherwise reading + proceeds (including null characters) until LEN characters have been read. + Set FETCHLIMIT to UINT_MAX to read as many characters as possible from the + string. -- Daniel Jacobowitz CodeSourcery