This is the mail archive of the gdb-patches@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]

[RFA/dwarf2] better check for external references


Hi Jim,

I'm moving the discussion from gdb to gdb-patches. The riginal post
was at: http://www.sourceware.org/ml/gdb/2007-01/msg00033.html.

Summary: we have a testcase where one of the types is declared as
an empty structure. A couple of guards in the dwarf2read code cause
GDB to ignore these types, and thus, GDB is unable to do a "ptype"
using these type names. Reproduced using C  with the new testcase
attached.

You suggested:

> 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."

Of course! Here is a patch that implements just that. I had to add
a new flag in struct partial_die_info for that, as you indicated.

2006-02-04  Joel Brobecker  <brobecker@adacore.com>

        * dwarf2read.c (partial_die_info): Add field has_byte_size.
        (add_partial_symbol): Correct identification of external references.
        (process_structure_scope): Likewise.
        (read_partial_die): Handle DW_AT_byte_size attribute.

2006-02-04  Joel Brobecker  <brobecker@adacore.com>

        * gdb.base/nofield.c: New file.
        * gdb.base/nofield.exp: New testcase.

Tested on x86-linux. No regressions. nofield.exp is an all PASS
after the patch is applied (had a couple of FAILs before).

OK to apply?

Thanks,
-- 
Joel

Attachment: external.diff
Description: Text document

Attachment: nofield.c
Description: Text document

Attachment: nofield.exp
Description: Text document


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