public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Michael Eager <eager@eagerm.com>
Cc: "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix check for ICC incomplete struct types
Date: Tue, 07 Jan 2014 18:43:00 -0000	[thread overview]
Message-ID: <87bnznhbtn.fsf@fleche.redhat.com> (raw)
In-Reply-To: <52CC3790.4030702@eagerm.com> (Michael Eager's message of "Tue,	07 Jan 2014 09:21:20 -0800")

>>>>> "Michael" == Michael Eager <eager@eagerm.com> writes:

Michael> GDB contains code in read_structure_type() which is supposed
Michael> to check for incorrect DWARF generated by ICC for an incomplete
Michael> structure type.  The code is incomplete, in that it doesn't
Michael> check for length == 0, and it doesn't set the STUB flag.

Thanks.

Michael> -  if (producer_is_icc (cu))
Michael> +  if (producer_is_icc (cu) && (TYPE_LENGTH (type) == 0))
Michael>      {
Michael>        /* ICC does not output the required DW_AT_declaration
Michael>  	 on incomplete types, but gives them a size of zero.  */
Michael> +      TYPE_STUB (type) = 1;
Michael>      }
Michael>    else
Michael>      TYPE_STUB_SUPPORTED (type) = 1;

It seems to me that TYPE_STUB_SUPPORTED should be set unconditionally
(and, btw, eww, what a big hack TYPE_STUB_SUPPORTED is).  Without the
TYPE_STUB_SUPPORTED setting, TYPE_IS_OPAQUE does not honor TYPE_STUB.

Then the icc check moved to the next stanza, say like:

  TYPE_STUB_SUPPORTED (type) = 1;
  if (die_is_declaration (die, cu))
    TYPE_STUB (type) = 1;
  else if (producer_is_icc (cu) && TYPE_LENGTH (type) == 0)
    {
      /* ICC does not output the required DW_AT_declaration
	 on incomplete types, but gives them a size of zero.  */
      TYPE_STUB (type) = 1;
    }
  else if (attr == NULL && die->child == NULL
	   && producer_is_realview (cu->producer))
    /* RealView does not output the required DW_AT_declaration
       on incomplete types.  */
    TYPE_STUB (type) = 1;

What do you think of this?


Tom

  reply	other threads:[~2014-01-07 18:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 17:21 Michael Eager
2014-01-07 18:43 ` Tom Tromey [this message]
2014-01-07 20:16   ` Michael Eager
2014-01-08 16:38     ` Tom Tromey

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=87bnznhbtn.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=eager@eagerm.com \
    --cc=gdb-patches@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).