This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 6/7] Move fixup_partial_die to partial_die_info::fixup
On 01/25/2018 09:38 AM, Yao Qi wrote:
> diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
> index 0ee102a..9b6f2ec 100644
> --- a/gdb/dwarf2read.c
> +++ b/gdb/dwarf2read.c
> @@ -1410,6 +1410,11 @@ struct partial_die_info
> load_partial_dies. */
> partial_die_info& operator=(const partial_die_info& rhs) = delete;
>
> + /* Adjust the partial die before generating a symbol for it. This
> + function may set the is_external flag or change the DIE's
> + name. */
> + void fixup (struct dwarf2_cu *cu);
> +
> /* Offset of this DIE. */
> const sect_offset sect_off;
>
> @@ -1442,9 +1447,6 @@ struct partial_die_info
> /* Flag set if any of the DIE's children are template arguments. */
> unsigned int has_template_arguments : 1;
>
> - /* Flag set if fixup_partial_die has been called on this die. */
> - unsigned int fixup_called : 1;
> -
> /* Flag set if DW_TAG_imported_unit uses DW_FORM_GNU_ref_alt. */
> unsigned int is_dwz : 1;
>
> @@ -1519,10 +1521,13 @@ struct partial_die_info
> has_byte_size = 0;
> has_const_value = 0;
> has_template_arguments = 0;
> - fixup_called = 0;
> + m_fixup_called = false;
> is_dwz = 0;
> spec_is_dwz = 0;
> }
> +
> + /* Flag set if fixup has been called on this die. */
> + bool m_fixup_called : 1;
> };
Currently, the boolean bits were all together for packing.
This moves the bit away from the others, after some pointer
fields, I think. This is probably growing the size of
the structure with some padding holes.
Thanks,
Pedro Alves