From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13433 invoked by alias); 4 Feb 2008 23:15:37 -0000 Received: (qmail 13425 invoked by uid 22791); 4 Feb 2008 23:15:37 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 04 Feb 2008 23:15:14 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 2E58C2AA322 for ; Mon, 4 Feb 2008 18:15:13 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id I2khNIpnZGvm for ; Mon, 4 Feb 2008 18:15:13 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E9C5E2AA321 for ; Mon, 4 Feb 2008 18:15:12 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id A745CE7ACB; Mon, 4 Feb 2008 15:15:10 -0800 (PST) Date: Mon, 04 Feb 2008 23:15:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: [RFA] Make symbol completion language-specific Message-ID: <20080204231510.GI21614@adacore.com> References: <20071228122825.GC24450@adacore.com> <20080129172800.GA3773@caradoc.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080129172800.GA3773@caradoc.them.org> User-Agent: Mutt/1.4.2.2i 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-02/txt/msg00096.txt.bz2 Hi Daniel, > > +struct string_vector > > +{ > > + char **array; /* The vector itself. */ > > + int index; /* Index of the next available element in the array. */ > > + size_t size; /* The number of entries allocated in the array. */ > > +}; > > We have a generic VEC nowadays. I just had a look, and I don't think the generic VEC integrates itself well with the current infrastructure. The type above works well, because I can then directly pass the char **array back to the caller of our completion routine (one of the callers is responsible for freeing it - see completer.c:line_completion_function). If I were to use a VEC, I would have to return a copy of the contents of the VEC, which seems silly because I'd end up immediately destroying an array that I just copied. I propose the following: - I check the current patch in, as is (with an extra comment explaining why we're not using a VEC). - I can work on a follow-up patch that changes the inferface of the completer to use VECs instead of a NULL-terminated arrays. It's unclear how much benefit it's going to bring, but I could work on that relatively soon. Thanks, -- Joel