From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19349 invoked by alias); 7 Oct 2010 04:14:59 -0000 Received: (qmail 19340 invoked by uid 22791); 7 Oct 2010 04:14:57 -0000 X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from syracuse.mckusick.com (HELO syracuse.mckusick.com) (64.81.247.46) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Oct 2010 04:14:52 +0000 Received: from syracuse.mckusick.com (localhost [127.0.0.1]) by syracuse.mckusick.com (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id o974EFNZ001911; Wed, 6 Oct 2010 21:14:15 -0700 Received: (from hilfingr@localhost) by syracuse.mckusick.com (8.14.3/8.14.3/Submit) id o974EFd5001910; Wed, 6 Oct 2010 21:14:15 -0700 Subject: Re: [RFA] Rework symbol searches to move Ada-specific stuff to ada-lang.c. From: Paul Hilfinger Reply-To: Hilfinger@cs.berkeley.edu To: Tom Tromey Cc: Hilfinger@adacore.com, gdb-patches@sourceware.org In-Reply-To: References: <201010050842.o958gDNO002818@syracuse.mckusick.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Date: Thu, 07 Oct 2010 04:14:00 -0000 Message-ID: <1286424854.1821.2.camel@syracuse.mckusick.com> Mime-Version: 1.0 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: 2010-10/txt/msg00112.txt.bz2 On Wed, 2010-10-06 at 16:51 -0600, Tom Tromey wrote: > >>>>> "Paul" =3D=3D Paul Hilfinger write= s: >=20 > Paul> +dw2_map_matching_symbols (const char* name, domain_enum namespace, >=20 > "const char *name" >=20 OK. > Paul> /* Lookup a partial symbol. */ > Paul> +static struct partial_symbol *match_partial_symbol (struct partial= _symtab *, > Paul> + int, > Paul> + const char *, domain_enum, > Paul> + int (*) (const char *, > Paul> + const char *), > Paul> + int (*) (const char *, > Paul> + const char *)); > Paul> + > Paul> + > Paul> static struct partial_symbol *lookup_partial_symbol (struct partia= l_symtab *, >=20 > This insertion separates a comment from the declaration it comments. >=20 > I think it is fine to just remove that comment, though. It doesn't > really add anything. >=20 OK > Paul> +/* Look in PST for a symbol in DOMAIN whose name matches NAME. Se= arch > Paul> + the global block of PST if GLOBAL, and otherwise the static blo= ck. > Paul> + MATCH is the comparison operation that returns true iff MATCH (= s, > Paul> + NAME), where s is a SYMBOL_SEARCH_NAME. If ORDERED_COMPARE is > Paul> + non-null, the symbols in the block are assumed to be ordered > Paul> + according to it (allowing binary search). It must be compatible > Paul> + with MATCH. Returns the symbol, if found, and otherwise NULL. = */ > Paul> +static struct partial_symbol * > Paul> +match_partial_symbol (struct partial_symtab *pst, int global, >=20 > We've recently started trying to enforce the rule about having a blank > line between a function comment and the start of the function > definition. OK. > Paul> + return (*top); >=20 > A few places have parens here, but they aren't needed. > Just write "return *top;". OK (BTW: That line was copied from the original). >=20 > Paul> + /* Find global or static symbols in all tables that are in NAMES= PACE=20 > Paul> + and for which MATCH (symbol name, NAME) =3D=3D 0, passing eac= h to=20 > Paul> + CALLBACK, reading in partial symbol symbol tables as needed. = Look > Paul> + through global symbols if GLOBAL and otherwise static symbols= .=20=20 > Paul> + Passes NAME, NAMESPACE, and DATA to CALLBACK with each symbol > Paul> + found. After each block is processed, passes NULL to CALLBAC= K. > Paul> + MATCH must be weaker than strcmp_iw in the sense that > Paul> + strcmp_iw(x,y) =3D=3D 0 --> MATCH(x,y) =3D=3D 0. ORDERED_COM= PARE, if > Paul> + non-null, must be an ordering relation compatible with strcmp= _iw > Paul> + in the sense that=20=20 > Paul> + strcmp(x,y) =3D=3D 0 --> ORDERED_COMPARE(x,y) =3D=3D 0= =20 > Paul> + and=20 > Paul> + strcmp(x,y) <=3D 0 --> ORDERED_COMPARE(x,y) <=3D 0 > Paul> + (allowing strcmp(x,y) < 0 while ORDERED_COMPARE(x, y) =3D=3D = 0).=20 > Paul> + CALLBACK returns 0 to indicate that the scan should continue,= or > Paul> + non-zero to indicate that the scan should be terminated. */ >=20 > Thanks for being so thorough in this comment. You're welcome. Paul