Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@zwingli.cygnus.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [patch] clarify ``struct type . length''
Date: Wed, 05 Sep 2001 10:59:00 -0000	[thread overview]
Message-ID: <npheuhms9w.fsf@zwingli.cygnus.com> (raw)
In-Reply-To: <3B81A9BC.4010807@cygnus.com>

Andrew Cagney <ac131313@cygnus.com> writes:
> I've checked the attatched in as an obvious fix.  It clarifies the 
> length field of the ``struct type''.

> !     /* Length of storage for a value of this type.  This is of length
> !        of the type as defined by the debug info and not the length of
> !        the value that resides within the type.  For instance, an
> !        i386-ext floating-point value only occupies 80 bits of what is
> !        typically a 12 byte `long double'.  Various places pass this to

I'm not sure I agree it's a clarification.  :)

type->length is simply what "sizeof()" would return.  Making a
distinction between the size "as defined by the debug info" vs. "the
value that resides within a type" is a bit murky.

(To begin with, values don't "reside in" types; they "have" types.
They reside in blocks of memory, or registers.)

I suggest:

Length of storage for a value of this type.  This is what sizeof
(type) would return; you use it for address arithmetic, memory reads
and writes, allocating buffers to hold the value in GDB, etc.  This
size may include padding: for example, an i386-ext floating-point
value is only ten bytes long, but most compilers assign it a size of
twelve bytes, so that arrays of floats are aligned better.


  reply	other threads:[~2001-09-05 10:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-21  6:41 Andrew Cagney
2001-09-05 10:59 ` Jim Blandy [this message]
2001-09-05 15:44   ` Jim Blandy

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=npheuhms9w.fsf@zwingli.cygnus.com \
    --to=jimb@zwingli.cygnus.com \
    --cc=ac131313@cygnus.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