This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix Ada "ptype" bug with array types


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]