From: Joel Brobecker <brobecker@adacore.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [rfa/Ada] Restructure array bounds routines to remove builtin types
Date: Mon, 29 Jun 2009 15:37:00 -0000 [thread overview]
Message-ID: <20090629153649.GA7584@adacore.com> (raw)
In-Reply-To: <200906261551.n5QFpSgt028255@d12av02.megacenter.de.ibm.com>
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
next prev parent reply other threads:[~2009-06-29 15:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-26 15:51 Ulrich Weigand
2009-06-29 15:37 ` Joel Brobecker [this message]
2009-06-29 17:29 ` Ulrich Weigand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090629153649.GA7584@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox