Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: Re: RFA/types: Clean up use of field bitsize
Date: Sun, 10 Nov 2002 16:57:00 -0000	[thread overview]
Message-ID: <20021111005823.GA19066@nevyn.them.org> (raw)
In-Reply-To: <20020930010515.GA27762@nevyn.them.org>

On Sun, Sep 29, 2002 at 09:05:15PM -0400, Daniel Jacobowitz wrote:
> Right now, we have this really disturbing comment:
> 
>      /* Size of this field, in bits, or zero if not packed.
>         For an unpacked field, the field's type's length
>         says how many bytes the field occupies.
>         A value of -1 or -2 indicates a static field;  -1 means the location
>         is specified by the label loc.physname;  -2 means that loc.physaddr
>         specifies the actual address. */
> 
> Think about this for a moment.  While in practice a static member is never
> going to be packed, and in at least C++ can not be a bit-field, that's not
> logically obvious for other languages.  I don't know Ada but I wouldn't be
> surprised if there were some construct which violated this assumption.
> 
> Worse, all sorts of places don't check for negative bitsize at all.  It may
> be that they're all safe - I didn't spend a lot of time working out problem
> cases - but I have my doubts.
> 
> So, since I needed to gain a new field here anyway, and since I have no
> compunctions about shrinking this field a little (packed bitfields of size
> greater than a couple of words are allowed in some languages IIRC (including
> GNU C maybe?  Although they are not allowed in ISO C99), but they're
> definitely dodgy), and since signed bitfields are not portable, I cleaned up
> the construct.  It turned out to be painless except for making sure symbol
> readers initialized it, which was a little tedious.
> 
> This patch:
>   Moves 'artificial' out from 'loc' and makes it a bitfield
>   Creates a 'static_kind' bitfield
>   Makes 'bitsize' into a bitfield
> 
> The goal is to allow more kinds of fields to be marked artificial -
> particularly data members.  After this patch I'll submit the followup to
> mark DW_AT_artificial members as artificial types.
> 
> OK?

It's in.  Now to do the followon for artificial members; this will let
us hide _vptr members in type output if requested.  And probably a set
option to toggle the artificial behavior...

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


      parent reply	other threads:[~2002-11-11  0:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-29 18:04 Daniel Jacobowitz
2002-09-29 22:08 ` Paul N. Hilfinger
2002-10-30 15:41 ` Daniel Jacobowitz
2002-11-06 12:41   ` Andrew Cagney
2002-11-06 12:53     ` Daniel Jacobowitz
2002-11-06 13:52       ` Andrew Cagney
2002-11-10 16:57 ` Daniel Jacobowitz [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=20021111005823.GA19066@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.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