From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20786 invoked by alias); 29 Jun 2009 15:37:01 -0000 Received: (qmail 20773 invoked by uid 22791); 29 Jun 2009 15:37:00 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Jun 2009 15:36:55 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 7188F2BAB19; Mon, 29 Jun 2009 11:36:53 -0400 (EDT) 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 CUn-3KWuitn5; Mon, 29 Jun 2009 11:36:53 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 39AA52BAAAD; Mon, 29 Jun 2009 11:36:53 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id B8013F5AF0; Mon, 29 Jun 2009 08:36:49 -0700 (PDT) Date: Mon, 29 Jun 2009 15:37:00 -0000 From: Joel Brobecker To: Ulrich Weigand Cc: gdb-patches@sourceware.org Subject: Re: [rfa/Ada] Restructure array bounds routines to remove builtin types Message-ID: <20090629153649.GA7584@adacore.com> References: <200906261551.n5QFpSgt028255@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200906261551.n5QFpSgt028255@d12av02.megacenter.de.ibm.com> User-Agent: Mutt/1.5.18 (2008-05-17) 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-06/txt/msg00815.txt.bz2 Hi Ulrich, First of all, thank you for doing this. I know it's painful to change someone else's code, sometime, especially when it's tough to test some of them. > - The ada_array_bound, ada_array_bound_from_type, and ada_array_length > now solely return numerical values (as LONGEST); they do not attempt > to do anything with types. I'm slightly concerned at this part, but I don't think your patch makes things any worse. In particular, I'm worried about arrays whose index type is an unsigned 64bit type. If I understand things correctly, I don't think it works well just yet, and PaulH was working on that. > * ada-lang.c (ada_index_type): Make static. Add NAME argument. > Throw error on invalid input arguments. Return NULL if unable > to determine index type. > > (ada_array_bound_from_type): Remove TYPEP argument. > (ada_array_bound): Make static. Return LONGEST instead of value. > Update for ada_array_bound_from_type change. > (ada_array_length): Return LONGEST instead of value. > Update for ada_array_bound_from_type change. > (make_array_descriptor): Update for ada_array_bound change. > > (ada_evaluate_subexp) [OP_ATR_RANGE, OP_ATR_FIRST, OP_ATR_LAST, > OP_ATR_LENGTH]: Update for ada_array_bound_from_type, > ada_array_bound, ada_array_length, ada_index_type changes. > Always use ada_index_type to compute result type; fall back > to architecture-specific integer type if ada_index_type fails. > > * ada-lang.h (ada_index_type): Remove prototype. > (ada_array_bound): Likewise. Looks OK to me, and verified also against AdaCore's testsuite on x86-linux (DWARF and stabs). Just one tiny request: > -struct type * > -ada_index_type (struct type *type, int n) > +static struct type * > +ada_index_type (struct type *type, int n, const char *name) Would you mind documenting what this new NAME parameter is supposed to be? Thanks, -- Joel