This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/3] fort_dyn_array: Enable dynamic member types inside a structure.
- From: "Heckel, Bernhard" <bernhard dot heckel at intel dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: "brobecker at adacore dot com" <brobecker at adacore dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 7 Apr 2016 08:03:27 +0200
- Subject: Re: [PATCH 1/3] fort_dyn_array: Enable dynamic member types inside a structure.
- Authentication-results: sourceware.org; auth=none
- References: <1458204189-13267-1-git-send-email-bernhard dot heckel at intel dot com> <1458204189-13267-2-git-send-email-bernhard dot heckel at intel dot com> <86h9fhpkkz dot fsf at gmail dot com> <570369BC dot 60407 at intel dot com> <86inzwnxik dot fsf at gmail dot com> <5703B2B4 dot 4090209 at intel dot com> <86d1q2n2hp dot fsf at gmail dot com>
On 06/04/2016 18:09, Yao Qi wrote:
"Heckel, Bernhard" <bernhard.heckel@intel.com> writes:
This should not be a problem as for all dynamic types we do first a
copy of the type before we start to resolve it.
Can you show me the code copying the type?
Therefore, next time when we print variables from the target we have
to resolve it's type again (as we resolved only the copy before).
In gdb/gdbtypes.c, line 2027 (line incl. patch)
static struct type *
resolve_dynamic_struct (struct type *type,
struct property_addr_info *addr_stack)
{
struct type *resolved_type;
int i;
unsigned resolved_type_bit_length = 0;
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT);
gdb_assert (TYPE_NFIELDS (type) > 0);
resolved_type = copy_type (type);
The same you find in:
- resolve_dynamic_array
- resolve_dynamic_range
- resolve_dynamic_union
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