From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94034 invoked by alias); 5 Mar 2018 14:35:25 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 94018 invoked by uid 89); 5 Mar 2018 14:35:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Mar 2018 14:35:23 +0000 Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 323AF300087C; Mon, 5 Mar 2018 15:35:21 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id E8336413CAA2; Mon, 5 Mar 2018 15:35:20 +0100 (CET) Message-ID: <1520260520.6142.5.camel@klomp.org> Subject: Re: [PATCH] readelf: Add some support for locviews. From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Alexandre Oliva Date: Mon, 05 Mar 2018 14:35:00 -0000 In-Reply-To: <20180301135506.1614-1-mark@klomp.org> References: <20180301135506.1614-1-mark@klomp.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2018-q1/txt/msg00069.txt.bz2 On Thu, 2018-03-01 at 14:55 +0100, Mark Wielaard wrote: > This adds minimal support for locviews as output by GCC8. > It changes readelf to keep track of loclistptrs from DW_AT_GNU_locviews > and prints the locview pairs for those. Since there is no terminator > we have to keep track of where the next loclist entry starts. > The --debug-dump=3Dloc output looks as follows: >=20 > =C2=A0CU [=C2=A0=C2=A0=C2=A0714] base: +0x0000000000003020 > =C2=A0[=C2=A0=C2=A0=C2=A0=C2=A0b4] view pair 1, 2 > =C2=A0[=C2=A0=C2=A0=C2=A0=C2=A0b6] range 4, 7f > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0+0x0000000000= 003024 .. > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0+0x0000000000= 00309e > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0[ 0] re= g5 > =C2=A0[=C2=A0=C2=A0=C2=A0=C2=A0d9] view pair 3, 1 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0view pair 1, 2 > =C2=A0[=C2=A0=C2=A0=C2=A0=C2=A0dd] range 4, 4c > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0+0x0000000000= 003024 .. > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0+0x0000000000= 00306b > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0[ 0] re= g5 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0range 4c, 7f > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0+0x0000000000= 00306c .. > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0+0x0000000000= 00309e > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0[ 0] re= g2 >=20 > Note that in the above output the view pairs correspond to the ranges > immediately following in the loc list. This is how GCC8 currently > outputs the locview pairs and ranges, but this is not guaranteed and > you'll need to look at the location and GNU_locviews attributes of the > DIE to know which really match up together. We might want to adjust the > output to make this more clear. >=20 > This does not yet add an locview accessor to libdw. It just recognizes > the DW_AT_GNU_locviews attribute as a loclistptr when encoded as a > sec_offset form. Pushed to master.