Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@codesourcery.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb@sourceware.org
Subject: Re: Ada testsuite failures
Date: Wed, 03 Jan 2007 22:21:00 -0000	[thread overview]
Message-ID: <m364bn7nvd.fsf@codesourcery.com> (raw)
In-Reply-To: <20070103140514.GA19241@adacore.com> (Joel Brobecker's message of "Wed, 3 Jan 2007 18:05:14 +0400")


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.


      parent reply	other threads:[~2007-01-03 22:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-31 19:46 Daniel Jacobowitz
2007-01-02  7:37 ` Joel Brobecker
2007-01-02 14:42   ` Daniel Jacobowitz
2007-01-02 16:31     ` Joel Brobecker
2007-01-02 11:38 ` Joel Brobecker
2007-01-02 14:39   ` Daniel Jacobowitz
2007-01-02 16:30     ` Joel Brobecker
2007-01-02 16:32       ` Joel Brobecker
2007-01-02 16:40         ` Daniel Jacobowitz
2007-01-02 16:50           ` Joel Brobecker
2007-01-03 14:04           ` Joel Brobecker
2007-01-03 14:05             ` Joel Brobecker
2007-01-03 22:21             ` Jim Blandy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m364bn7nvd.fsf@codesourcery.com \
    --to=jimb@codesourcery.com \
    --cc=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox