This is the mail archive of the 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 1/3] fort_dyn_array: Enable dynamic member types inside a structure.

On 06/04/2016 18:09, Yao Qi wrote:
"Heckel, Bernhard" <> 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,
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

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