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>,  "'Daniel Jacobowitz'" <drow@false.org>,
		  "'Jim Wilson'" <wilson@specifix.com>
Subject: Re: how to support C type qualifiers applied to arrays?
Date: Wed, 27 Dec 2006 02:12:00 -0000	[thread overview]
Message-ID: <m3d56684u3.fsf@codesourcery.com> (raw)
In-Reply-To: <004901c723e0$303c67a0$0a0a0a0a@DELORIAN> (Gary Funck's message of "Tue, 19 Dec 2006 18:40:15 -0800")


"Gary Funck" <gary@intrepid.com> writes:
>> From: Jim Blandy
>> Sent: Friday, December 15, 2006 2:37 PM
>> 
>> "Gary Funck" <gary@intrepid.com> writes:
>> > Here, GCC sets TREE_THIS_VOLATILE in the DECL node of S,
>> > but does not attempt to clone the type description of
>> > s_struct, and to populate the volatile qualifier across all
>> > contained member types.  This works for GCC because it
>> > propagates the qualifiers as it evaluates expressions.
>> > Thus when evaluating S.c[10], GCC starts with the knowledge
>> > that S is volatile, thus S.c is volatile, and S.c[1] is
>> > volatile.
>> 
>> Okay --- this is a different problem altogether.  This one is indeed
>> GDB's fault: referring to a field of a volatile- or const-qualified
>> structure should get you a member with the same qualifiers.
>> [...]
>> > Typedefs above are used to illustrate that "volatile" must
>> > be factored to the lowest level types of the components,
>> > and must also appear at the struct level to accommodate
>> > operations on the entire structure.
>> 
>> Just to be clear: GCC should *not* perform the transformation you're
>> suggesting here and record the result in the DWARF info.  GDB should
>> propagate the qualifiers itself.
>
> This leads to the next question: how difficult will it be to
> teach GDB to properly track type qualifiers when evaluating
> expressions?  Which files/functions will likely need to be
> changed?  Are there mechanisms within GDB already that track
> various value attributes along with the expression values
> themselves?

I think that should be a pretty straightforward change to
value_primitive_field, value_subscripted_rvalue, and probably
value_coerce_array.


  reply	other threads:[~2006-12-27  2:12 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
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 [this message]
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=m3d56684u3.fsf@codesourcery.com \
    --to=jimb@codesourcery.com \
    --cc=drow@false.org \
    --cc=gary@intrepid.com \
    --cc=gdb@sourceware.org \
    --cc=wilson@specifix.com \
    /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