This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix Ada "ptype" bug with array types
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tromey at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 16 Mar 2019 06:32:49 +0100
- Subject: Re: [PATCH] Fix Ada "ptype" bug with array types
- References: <20190313214157.24522-1-tromey@adacore.com>
Hi Tom,
On Wed, Mar 13, 2019 at 03:41:57PM -0600, Tom Tromey wrote:
> Using ptype on an array type in Ada can sometimes show an incorrect
> high bound. This happens because ada_evaluate_subexp will create an
> array with an incorrect upper bound in the EVAL_AVOID_SIDE_EFFECTS
> case.
>
> This patch fixes the problem by arranging to always create such an
> array with valid bounds.
>
> Tested on x86-64 Fedora 29.
>
> gdb/ChangeLog
> 2019-03-13 Tom Tromey <tromey@adacore.com>
>
> * ada-lang.c (empty_array): Add "high" parameter.
> (ada_evaluate_subexp): Update.
>
> gdb/testsuite/ChangeLog
> 2019-03-13 Joel Brobecker <brobecker@adacore.com>
> Tom Tromey <tromey@adacore.com>
>
> * gdb.ada/ptype_array/pck.adb: New file.
> * gdb.ada/ptype_array/pck.ads: New file.
> * gdb.ada/ptype_array/foo.adb: New file.
> * gdb.ada/ptype_array.exp: New file.
Thanks for the patch. It looks good to me!
--
Joel