Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Change ptype/o to print bit offset
Date: Mon, 29 Apr 2019 20:10:00 -0000	[thread overview]
Message-ID: <fb3f303f-a257-bf4e-7625-efbc26514880@FreeBSD.org> (raw)
In-Reply-To: <20190429183105.15973-3-tromey@adacore.com>

On 4/29/19 11:31 AM, Tom Tromey wrote:
> This is better, IMO, because now the "offset" of a bitfield is
> consistent with the offset of an ordinary member, referring to its
> offset from the start of the structure.

I agree with this.  This is what I use ptype /o for (to get starting
offsets).  pahole's format may make sense if the bits were numbered
N -> 0 instead of 0 -> N, or if bitfields used "high" bits instead of
"low" bits, but the convention I always see is to use 0 for LSB and
N for MSB.  I'm also assuming that compilers start with the LSB when
assigning bits to bitfield members.

-- 
John Baldwin


  parent reply	other threads:[~2019-04-29 20:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 18:31 [PATCH 0/2] two ptype/o changes Tom Tromey
2019-04-29 18:31 ` [PATCH 2/2] Change ptype/o to print bit offset Tom Tromey
2019-04-29 18:52   ` Eli Zaretskii
2019-04-29 18:57     ` Tom Tromey
2019-04-29 20:10   ` John Baldwin [this message]
2019-05-08 16:14 ` [PATCH 0/2] two ptype/o changes 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=fb3f303f-a257-bf4e-7625-efbc26514880@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.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