This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] [Ada] Enhance type printing for arrays with variable-sized elements
- From: Pierre-Marie de Rodat <derodat at adacore dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 15 Sep 2015 23:19:04 +0200
- Subject: Re: [PATCH] [Ada] Enhance type printing for arrays with variable-sized elements
- Authentication-results: sourceware.org; auth=none
- References: <1442315486-4885-1-git-send-email-derodat at adacore dot com> <20150915160611 dot GA20575 at adacore dot com>
On 09/15/2015 06:06 PM, Joel Brobecker wrote:
This looks like an easy improvement. Thanks, Pierre-Marie!
Yes it is. ;-)
I'm curious - what happens if you do:
(gdb) print a
(gdb) ptype $
The concern is that $ refers to the resolved version of "A", and
that therefore we might lose the dynamic property. But I think it will
work in this case, because we do not resolve the array's element type
(each element of the actual array has to be resolved individually,
since the actual type changes from element to element).
It's worth extending your new testcase with the above scenario as well,
I think.
Huh, very interesting, thanks for raising this! Your intuition is
correct: this already works for this reason. I've extended the testcase
to check exactly this.
Other than that, the patch itself looks pretty good to me.
The updated patch is pushed. Thank you for reviewing!
--
Pierre-Marie de Rodat