This is the mail archive of the gdb@sourceware.org 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: Ada testsuite failures


Joel Brobecker <brobecker@adacore.com> writes:
> The guards cited above have been there since version 1.1 of dwarf2read.c.
> I don't know how relevant they are now - presumably today's compilers
> would rather use a declaration attribute rather than empty structs.
> Strictly speaking, the guard as implemented is wrong. So I propose to
> simply remove it.
>
> 2006-02-03  Joel Brobecker  <brobecker@adacore.com>
>
>         * dwarf2read.c (add_partial_symbol): Update copyright year.
>         Do not skip struct, union and enum types with no children.
>
> 2006-02-03  Joel Brobecker  <brobecker@adacore.com>
>
>         * gdb.base/nofield.c: New file.
>         * gdb.base/nofield.exp: New testcase.
>
> Tested on x86_64-linux. No regression. Nofield.exp has two FAILs before
> the patch, and is all PASS after.

The change to process_structure_type is almost right, but I'm pretty
sure the change to add_partial_symbol isn't.

The partial symtab scan shouldn't create psymbols for incomplete
struct types, since we don't want to read in this compilation unit
when the user enters a reference to the type.  So the test in
add_partial_symbol should use the criteria in the DWARF spec for
recognizing incomplete structure types; section 5.6.1 "Structure,
Union, and Class Type Entries", says "An incomplete structure, union
or class type is represented by a structure, union or class entry that
does not have a byte size attribute and that has a DW_AT_declaration
attribute."

At the moment, there's nothing in 'struct partial_die_info' that would
tell you if the die has a size, but it looks easy enough to add.

In process_structure_scope, we should drop the child test, as your
patch does, but also check for the presence of DW_AT_byte_size.


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