From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61868 invoked by alias); 2 Oct 2019 16:14:53 -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 61858 invoked by uid 89); 2 Oct 2019 16:14:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1333, SPECIAL, ending, H*Ad:U*elfutils-devel X-Spam-Status: No, score=-6.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) 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; Wed, 02 Oct 2019 16:14:50 +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 F2D113000B1B; Wed, 2 Oct 2019 18:14:47 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id AE2A1401EDB4; Wed, 2 Oct 2019 18:14:47 +0200 (CEST) Message-ID: Subject: Re: line info From: Mark Wielaard To: Sasha Da Rocha Pinheiro Cc: "elfutils-devel@sourceware.org" Date: Wed, 02 Oct 2019 16:14:00 -0000 In-Reply-To: References: , <20190912090037.GB8222@wildebeest.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-5.el7) Mime-Version: 1.0 X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2019-q4/txt/msg00000.txt.bz2 Hi Sasha, Sorry for the late reply. On Thu, 2019-09-12 at 15:22 +0000, Sasha Da Rocha Pinheiro wrote: > For my knowledge about it, this information is not encoded in the > dwarf_line state machine instructions. Right? Would you know how to > get it? >=20 > I know that the state machine will shift line number and address > number to encode instructions such as: > DW_LNS_fixed_advance_pc > SPECIAL(2, 0) > DW_LNS_fixed_advance_pc > SPECIAL(2, 0) > DW_LNS_fixed_advance_pc > SPECIAL(1, 0) > DW_LNS_fixed_advance_pc > SPECIAL(1, 0) > DW_LNS_fixed_advance_pc > DW_LNE_end_sequence >=20 > And that does not give us range end. Am I correct? Can we make any > assumptions for it? The line number table gives a mapping from addresses to source line. You could get the reverse information out of it, but since the table is ordered by addresses it isn't very convenient to construct a source line to addresses mapping. Also there is no guarantee that any source line will map to a continuous range of addresses, so there might not be one starting address and one ending address. I don't know what you really need this for, but you could get some information about function or some syntactical scopes from the DIE tree. Which you can get with dwarf_ranges (). Which might or might not be what you are looking for? Cheers, Mark