Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [RFA-v2] dwarf2read.c: Avoid complaint for char array of unspecified size
Date: Thu, 27 May 2010 20:09:00 -0000	[thread overview]
Message-ID: <m3ljb5f6qt.fsf@fleche.redhat.com> (raw)
In-Reply-To: <34200.8848595016$1274864816@news.gmane.org> (Pierre Muller's	message of "Wed, 26 May 2010 11:06:42 +0200")

>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:

Pierre> 2010-05-26  Pierre Muller  <muller@ics.u-strasbg.fr>
Pierre> 	* dwarf2read.c (read_subrange_type): Create default subrange
Pierre> 	type if DIE->NUM_ATTRS is zero.

I think this is an improvement, but it would be preferable to just
directly implement what DWARF specifies:

    If the subrange entry has no type attribute describing the basis
    type, the basis type is assumed to be the same as the object
    described by the lower bound attribute (if it references an
    object). If there is no lower bound attribute, or that attribute
    does not reference an object, the basis type is the type of the
    upper bound or count attribute (if either of them references an
    object). If there is no upper bound or count attribute, or neither
    references an object, the type is assumed to be the same type, in
    the source language of the compilation unit containing the subrange
    entry, as a signed integer with the same size as an address on the
    target machine.

Pierre> +  if (die->num_attrs == 0)

A DW_TAG_subrange_type might have attributes that we ignore.  So, I
think there is no need for a check that is this specific; just determine
the type according to the above algorithm, and remove the existing
complaint code.

Tom


  parent reply	other threads:[~2010-05-27 20:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <38685.0063725889$1274473713@news.gmane.org>
2010-05-21 22:13 ` [RFA] " Tom Tromey
2010-05-21 23:55   ` Pierre Muller
2010-05-24 15:35     ` Tom Tromey
2010-05-26 15:21       ` [RFA-v2] " Pierre Muller
     [not found]       ` <34200.8848595016$1274864816@news.gmane.org>
2010-05-27 20:09         ` Tom Tromey [this message]
2010-05-28 10:17           ` [RFA-v3] " Pierre Muller
2010-06-01 19:07             ` Tom Tromey
2010-06-02  6:25               ` Pierre Muller
2010-06-02 19:35                 ` 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=m3ljb5f6qt.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    /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