dwarves.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Mark Wielaard <mark@klomp.org>, dwarves@vger.kernel.org
Subject: Re: [PATCH/RFC] Re: DWARF5 DW_AT_data_bit_offset
Date: Thu, 28 Jan 2021 10:54:45 -0300	[thread overview]
Message-ID: <20210128135445.GF775562@kernel.org> (raw)
In-Reply-To: <20210128125443.GI3832029@redhat.com>

Em Thu, Jan 28, 2021 at 12:54:43PM +0000, Daniel P. Berrangé escreveu:
> On Thu, Jan 28, 2021 at 09:11:22AM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Thu, Jan 21, 2021 at 12:35:16PM +0100, Mark Wielaard escreveu:
> > > On Fri, Oct 02, 2020 at 06:18:19PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > Em Fri, Oct 02, 2020 at 06:11:06PM +0200, Mark Wielaard escreveu:
> > > > > Seems pahole with a recent version of elfutils libdw already handles
> > > > > most DWARF5 encodings. One thing it doesn't handle yet is
> > > > > DW_AT_data_bit_offset (this is actually a DWARF4 thing, but gcc only
> > > > > emits it for -gdwarf-5).
> > 
> > <SNIP>
> > 
> > > > > $ gcc -gdwarf-5 -c bf.c
> > > > > $ ./pahole ./bf.o 
> > > > > DW_AT_<0xd>=0x21
> > > > > DW_AT_<0xd>=0x21
> > > > > DW_AT_<0xd>=0x21
> > > > > struct pea {
> > > > > 	int                        type;                 /*     0     4 */
> > > > > 	static long int                   a;             /*     0     0 */
> > > > > 	static long int                   b;             /*     0     0 */
> > > > > 	static long int                   c;             /*     0     0 */
> > > > > 
> > > > > 	/* size: 8, cachelines: 1, members: 1, static members: 3 */
> > > > > 	/* padding: 4 */
> > > > > 	/* last cacheline: 8 bytes */
> > > > > };
> > 
> > > > > Note that GCC11 might default to DWARF5.
> > 
> > > > Thanks for the detailed report, I'm releasing v1.18 right now, will look
> > > > into that for v1.19.
> > 
> > > Note that GCC11 indeed just switched to producing DWARF5 by default.
> > > It is not released yet, but already in stage4 and Fedora will start
> > > doing a mass-rebuild with it soon to shake out the last remaining bugs.
> > 
> > So, 1.20 will have the fix below, please check if what is in:
> > 
> > https://git.kernel.org/pub/scm/devel/pahole/pahole.git/log/?h=DW_AT_data_bit_offset
> > 
> > Fixes it for you, the cset with all the tests performed is this one:
> > 
> > https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?h=DW_AT_data_bit_offset&id=a77f039bb49bc97badf938049245f013fe3de4aa
> > 
> > Now looking at https://bugzilla.redhat.com/show_bug.cgi?id=1919965 ...
> 
> The XDR generated code example I give in that bug *does* appear
> to be fixed when using your  DW_AT_data_bit_offset branch.

[acme@five berrange]$ rpcgen  -c admin.x > admin.c
[acme@five berrange]$ rpcgen  -h admin.x > admin.h
[acme@five berrange]$ gcc -gdwarf-4 -c `pkg-config --cflags --libs libtirpc`  -o admin.o admin.c
[acme@five berrange]$ pdwtags --verbose admin.o > pdwtags.dwarf-4.txt
[acme@five berrange]$ gcc -gdwarf-5 -c `pkg-config --cflags --libs libtirpc`  -o admin.o admin.c
[acme@five berrange]$ pdwtags --verbose admin.o > pdwtags.dwarf-5.txt
[acme@five berrange]$ diff -u pdwtags.dwarf-4.txt pdwtags.dwarf-5.txt
[acme@five berrange]$

I'll go ahead and add a:

Acked-by: "Daniel P. Berrangé" <berrange@redhat.com>

Ok?

- Arnaldo

      parent reply	other threads:[~2021-01-28 13:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 16:11 DWARF5 DW_AT_data_bit_offset Mark Wielaard
2020-10-02 21:18 ` Arnaldo Carvalho de Melo
2021-01-21 11:35   ` Mark Wielaard
2021-01-28 12:11     ` [PATCH/RFC] " Arnaldo Carvalho de Melo
2021-01-28 12:54       ` Daniel P. Berrangé
2021-01-28 13:48         ` Arnaldo Carvalho de Melo
2021-01-28 13:54         ` Arnaldo Carvalho de Melo [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=20210128135445.GF775562@kernel.org \
    --to=acme@kernel.org \
    --cc=berrange@redhat.com \
    --cc=dwarves@vger.kernel.org \
    --cc=mark@klomp.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;
as well as URLs for NNTP newsgroup(s).