Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@codesourcery.com>
To: Gary Funck <gary@intrepid.com>
Cc: gdb@sourceware.org
Subject: Re: how to support C type qualifiers applied to arrays?
Date: Mon, 27 Nov 2006 23:30:00 -0000	[thread overview]
Message-ID: <m3u00kcvr3.fsf@codesourcery.com> (raw)
In-Reply-To: <20061127230948.GA19798@nevyn.them.org> (Daniel Jacobowitz's message of "Mon, 27 Nov 2006 18:09:48 -0500")


Daniel Jacobowitz <drow@false.org> writes:
> On Mon, Nov 27, 2006 at 02:42:12PM -0800, Gary Funck wrote:
>> Q: Is GCC generating an inaccurate DWARF 2 representation
>> to describe a qualified array type, or is GDB not
>> interpreting the DWARF 2 information correctly?
>
> I will defer to experts on this but I believe GCC is incorrect.

I think GCC is wrong, too.  The DWARF is unambiguous, and it's
attaching the qualifiers to the wrong part of the type tree, just as
Daniel says.

> My first recommendation would be to have make_cv_type create a new
> array type, with the qualified element type.  However, doing this
> without being excessively wasteful might require care - you couldn't
> reuse main_type since the qualified array could not share main_type.
> But the waste is acceptably small.

If this were a less obscure feature, then I could see GDB deliberately
misreading the DWARF to accomodate GCC.  But in this case, it doesn't
seem like a show-stopper; wouldn't it be better to just report the GCC
bug and let GDB continue to interpret DWARF as written?  These kludges
come back to haunt us.  I gather Gary is working with a modified GCC
anyway, so it shouldn't be hard for him to fix his compiler.  (If
that's not so, Gary, please set me straight.)


  reply	other threads:[~2006-11-27 23:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-27 22:42 Gary Funck
2006-11-27 23:10 ` Daniel Jacobowitz
2006-11-27 23:30   ` Jim Blandy [this message]
2006-11-27 23:52     ` Daniel Jacobowitz
2006-11-27 23:45   ` Joseph S. Myers
2006-11-27 23:55     ` Daniel Jacobowitz
2006-12-14 20:22       ` Gary Funck
2006-12-15 22:36         ` Jim Blandy
2006-12-19 19:09           ` Gary Funck
2006-12-20  2:40           ` Gary Funck
2006-12-27  2:12             ` Jim Blandy
2007-01-01 22:16         ` Jim Wilson
2007-01-09 17:01           ` Gary Funck

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=m3u00kcvr3.fsf@codesourcery.com \
    --to=jimb@codesourcery.com \
    --cc=gary@intrepid.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