From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105586 invoked by alias); 14 Jul 2017 10:03:50 -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 103864 invoked by uid 89); 14 Jul 2017 10:03:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=BAYES_00,GIT_PATCH_1,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=Hx-languages-length:821 X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,GIT_PATCH_1,KAM_LAZY_DOMAIN_SECURITY 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; Fri, 14 Jul 2017 10:03:48 +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 EB498300070A; Fri, 14 Jul 2017 12:03:45 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id DAE0340E39E6; Fri, 14 Jul 2017 12:03:45 +0200 (CEST) Message-ID: <1500026625.14595.238.camel@klomp.org> Subject: Re: File index given line (libdw) From: Mark Wielaard To: Sasha Da Rocha Pinheiro Cc: "elfutils-devel@sourceware.org" Date: Fri, 14 Jul 2017 10:03:00 -0000 In-Reply-To: References: <1499937069.14595.215.camel@klomp.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.12.11 (3.12.11-22.el7) Mime-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2017-q3/txt/msg00006.txt.bz2 On Thu, 2017-07-13 at 17:33 +0000, Sasha Da Rocha Pinheiro wrote: > given a Die, I want to associate each line (from dwarf_getsrclines) to > a file (from dwarf_getsrcfiles). The only way to do this is get the > filename returned by dwarf_linesrc, and search in the filenames given > by dwarf_getsrcfiles and dwarf_filesrc. But this is expensive since > this has to be done for each line. Instead, if I could get the file > index in the array "struct Dwarf_Fileinfo_s info", I wouldn't need to > search. But why do you want to do that? If we would add int dwarf_line_index (Dwarf_Line *line, size_t *idx) how exactly would you use it? What would be a good testcase for this new functionality? A small example program would help to see what the exact semantics should be. Thanks, Mark