Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Mark Wielaard <mjw@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA/DWARF] constant class of DW_AT_high_pc is offset for version >=4 only.
Date: Mon, 17 Feb 2014 09:19:00 -0000	[thread overview]
Message-ID: <20140217091929.GB5006@adacore.com> (raw)
In-Reply-To: <1392578342.21975.12.camel@bordewijk.wildebeest.org>

Hi Mark,

> Sorry about that. I read the spec as disallowing anything except
> DW_FORM_addr to encode class address. And since before DWARF4
> DW_AT_high_pc only allowed class address it hadn't occurred to me that
> it could have been encoded differently. I do think this really is a bug
> in the compiler that generated this.

Not to worry! I did find the use of data4 for a high_pc to be unusual,
for sure, and had to read the DWARF standard a couple of times to make
sure there was no such restriction. I'm pretty sure that I would have
made the same decision.

> > This patch fixes it by ammending a bit the changes from the commit
> > mentioned above to use the new interpretation of a relative address
> > only when the CU's DWARF version is 4 or greater.
> 
> That should work fine. GCC at least doesn't generate DW_AT_high_pc
> attributes as offsets (constant class) unless it generates DWARF4+.

Yes, I forgot to mention that I double-checked that it wouldn't
break GCC-compiled binaries.

Thanks!
-- 
Joel

PS: Since I have you - do you think binutils would need the same
    sort of change? I thought so too, when I looked at the code,
    but I couldn't get readelf to print the wrong address. Do you
    happen to know?


  reply	other threads:[~2014-02-17  9:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-15 15:40 Joel Brobecker
2014-02-16 19:19 ` Mark Wielaard
2014-02-17  9:19   ` Joel Brobecker [this message]
2014-02-18 13:30 ` Joel Brobecker
2014-02-18 16:03   ` Mark Wielaard
2014-02-18 18:49     ` Joel Brobecker
2014-02-18 20:29       ` Doug Evans
2014-02-18 21:52       ` Mark Wielaard
2014-02-19  7:23         ` Joel Brobecker
2014-02-19 13:44           ` Mark Wielaard
2014-02-21 18:42             ` Joel Brobecker
2014-02-26 10:53               ` Mark Wielaard
2014-02-26 19:45               ` pushed: " Joel Brobecker

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=20140217091929.GB5006@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mjw@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