From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32142 invoked by alias); 29 Jan 2008 17:28:24 -0000 Received: (qmail 32134 invoked by uid 22791); 29 Jan 2008 17:28:24 -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.31) with ESMTP; Tue, 29 Jan 2008 17:28:03 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 0488898151; Tue, 29 Jan 2008 17:28:02 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id DF53D9811F; Tue, 29 Jan 2008 17:28:01 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1JJuFd-000187-0j; Tue, 29 Jan 2008 12:28:01 -0500 Date: Tue, 29 Jan 2008 17:35:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Make symbol completion language-specific Message-ID: <20080129172800.GA3773@caradoc.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sourceware.org References: <20071228122825.GC24450@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071228122825.GC24450@adacore.com> User-Agent: Mutt/1.5.17 (2007-12-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-01/txt/msg00696.txt.bz2 On Fri, Dec 28, 2007 at 04:28:25AM -0800, Joel Brobecker wrote: > 1. How does someone verify that a GDB command does not return > any output. Do we really have to do it "manually" (using > gdb_send et al)? Right now, there is a hole in my testcase > regarding this, and I need to fix it before I commit it. Pretty much, though I think you could do it with gdb_test_multiple; see how lib/mi-support.exp does it. MI tests are anchored by default. There may be more trouble doing it for the CLI, though, because readline puts extra stuff in the output sometimes. > 2. I was getting tired of writing expected output regexps that > were completely unreadable mostly because the output was matching > more than one line that ended up concatenated inside the same > string. So I wrote the following little helper function: > > proc multi_line { args } { > return [join $args "\[\r\n\]*"] > } > > This function allows me to do something like this: > > gdb_test "print variable" \ > [multi_line "first_line" \ > "second_line" \ > "last_line" ] \ > "print big variable" > > I think that this is far easier to read than: > > gdb_test "print variable" \ > "first_line${eol}second_line${eol}last_line" > "print big variable" Also see gdb_expect_list, which is similar. I think that the way you've written it lends to things being too far indented, which will be hard to read... > Index: ada-lang.c > =================================================================== > --- ada-lang.c (revision 12) > +++ ada-lang.c (revision 13) > @@ -68,6 +68,17 @@ > #define TRUNCATION_TOWARDS_ZERO ((-5 / 2) == -2) > #endif > > +/* A structure that contains a vector of strings. > + The main purpose of this type is to group the vector and its > + associated parameters in one structure. This makes it easier > + to handle and pass around. */ > + > +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. You left the "should be language specific" FIXME :-) And a general comment, I'm not thrilled at the amount of generic symbol table code had to be duplicated in the Ada-specific files. But that's the status quo for ada-lang.c, anyway. I have no objections, despite the above whining. -- Daniel Jacobowitz CodeSourcery