This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/3] fort_dyn_array: Use value constructor instead of raw-buffer manipulation.
- From: "Heckel, Bernhard" <bernhard dot heckel at intel dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: brobecker at adacore dot com, gdb-patches at sourceware dot org, Keven Boell <keven dot boell at intel dot com>
- Date: Tue, 5 Apr 2016 11:30:59 +0200
- Subject: Re: [PATCH 3/3] fort_dyn_array: Use value constructor instead of raw-buffer manipulation.
- Authentication-results: sourceware.org; auth=none
- References: <1458204189-13267-1-git-send-email-bernhard dot heckel at intel dot com> <1458204189-13267-4-git-send-email-bernhard dot heckel at intel dot com> <868u0tpji4 dot fsf at gmail dot com>
On 04/04/2016 15:54, Yao Qi wrote:
Bernhard Heckel <bernhard.heckel@intel.com> writes:
Instead of pre-computing indices into a fortran array re-use
the value_* interfaces to subscript a fortran array.
Hi, can you elaborate a little please? It looks like change to new
interface, but why does this fix the bug? because value_* interfaces
have been aware of dynamic type?
Yes, you are right. value_* interface (value_field) takes care about
types with dynamic locations. This means the contents
for dynamic field types of structures are not at "Addr_of (type) +
TYPE_FIELD_BITPOS (type, index) / 8" but at the value
of the dynamic location attribute which is already resolved.
So, switching to the new interfaces solves the issue mentioned in the
commit message.
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928