From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17207 invoked by alias); 17 Jul 2017 17:28:57 -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 15679 invoked by uid 89); 17 Jul 2017 17:28:56 -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=-6.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-6.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,RP_MATCHES_RCVD,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: smtpauth3.wiscmail.wisc.edu Received: from wmauth3.doit.wisc.edu (HELO smtpauth3.wiscmail.wisc.edu) (144.92.197.226) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Jul 2017 17:28:54 +0000 MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 8.0.1.1.0 64bit (built Jun 15 2016)) id <0OT800500WFPCE00@smtpauth3.wiscmail.wisc.edu> for elfutils-devel@sourceware.org; Mon, 17 Jul 2017 12:28:52 -0500 (CDT) X-Spam-Report: AuthenticatedSender=yes, SenderIP=207.46.163.84 X-Spam-PmxInfo: Server=avs-3, Version=6.3.3.2656215, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2017.7.17.172116, AntiVirus-Engine: 5.38.0, AntiVirus-Data: 2017.7.15.5380004, SenderIP=207.46.163.84 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02lp0084.outbound.protection.outlook.com [207.46.163.84]) by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 8.0.1.1.0 64bit (built Jun 15 2016)) with ESMTPS id <0OT800L50WK45B30@smtpauth3.wiscmail.wisc.edu>; Mon, 17 Jul 2017 12:28:52 -0500 (CDT) Received: from BN6PR06MB3090.namprd06.prod.outlook.com (10.174.95.164) by BN6PR06MB3090.namprd06.prod.outlook.com (10.174.95.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.13; Mon, 17 Jul 2017 17:28:51 +0000 Received: from BN6PR06MB3090.namprd06.prod.outlook.com ([10.174.95.164]) by BN6PR06MB3090.namprd06.prod.outlook.com ([10.174.95.164]) with mapi id 15.01.1261.021; Mon, 17 Jul 2017 17:28:51 +0000 From: Sasha Da Rocha Pinheiro To: Mark Wielaard Cc: "elfutils-devel@sourceware.org" Subject: Re: File index given line (libdw) Thread-topic: File index given line (libdw) Thread-index: AQHS+25iE5CfcOrVI0yo3Q9kgzQif6JReRGAgACIteeAARhSgIAA+vQzgADYRQCAAoC2coAAlW+AgABH1+E= Date: Mon, 17 Jul 2017 17:28:00 -0000 Message-id: References: <1499937069.14595.215.camel@klomp.org> <1500026625.14595.238.camel@klomp.org> <1500126960.14595.310.camel@klomp.org> <1500296643.14595.353.camel@klomp.org> In-reply-to: <1500296643.14595.353.camel@klomp.org> Accept-Language: en-US, pt-BR Content-language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: X-Originating-IP: [128.105.14.107] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR06MB3090;7:1WJIU2LvPhopXtM3M10ES4qweJxbVuKzZMnfZM0Dt6PEHdSt4gFtRyCGetBw6WNj97kOhudmxIwEoUsor3LIIlEW9DQmNYorOJlq15SEZHYFA2gCC4IezBpXh/aoxrxTgtxXNI0hRy9IEpvGjqujYUI58leQTE11KYVPNXd9ZwWCB730uEoWW7sTiS+5dHCsJJcjrLnu1gpNkCAZ6KaLyK52Kye1nEBaEez4dtCueO3rK7kvwNx3DwEbAgNvOR1I4wBabCxNQ7NRfgLFthJtFZM2HQ8HlvlA9Z92rTMLnXFeElnqOAHwCBMWopZOE2LgV3H6MiQqrWAdPPYCaS/dDd0uYW3hYpG+enn2kdB3V9auCnzBdYILuT+PaQZ8ND9AKXtxNO3UhHGqhawsjg4onscWOXo43zP2eDRFPmhf36DtOALBDfnVl9RsorBBiRZKdu6kDhPJa3egk1wuZN7esxVQIWPpct5QImF5eIciesOx434z5TMbrnEmjnOaRwWwCiBXrHO5qWAkwObQN89qsSxCjJN6ivXPgCZpsSOyLzOtsq9iU8tsJ4K2NEC8xuSQ8JgUFvlHmbHzTu+FP1WCEreOuYhDQxmKmdd2wfnVNPAo2jiZJbVbVbSk5MYr9QeTG86ySYzPbguvyHP6dcY4j1iLqj68CFpv2Tp7SmC+SfHYfa3sA4+PbLRsLXHjbKJo/nS9XG75eRLrC9ZB07j+ll67UepxRKJxyTOeTUUbK3XXgUZB7rbdRxgnhRgTEzRolsaUzgdTpCkPD6ISuF5ulQOq9D0rBtk4/b5tWL2dKgI= x-ms-office365-filtering-correlation-id: 856c6372-18d2-4d38-4971-08d4cd394a61 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(48565401081)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BN6PR06MB3090; x-ms-traffictypediagnostic: BN6PR06MB3090: x-exchange-antispam-report-test: UriScan:(236129657087228)(48057245064654); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(2017060910075)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN6PR06MB3090;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN6PR06MB3090; x-forefront-prvs: 0371762FE7 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39840400002)(39400400002)(39450400003)(39410400002)(39860400002)(39850400002)(24454002)(377454003)(377424004)(478600001)(229853002)(93886004)(86362001)(7736002)(3280700002)(88552002)(53936002)(8936002)(4326008)(3846002)(6116002)(102836003)(2950100002)(6916009)(50986999)(99286003)(53546010)(55016002)(54356999)(38730400002)(76176999)(110136004)(7696004)(5890100001)(9686003)(6246003)(25786009)(6506006)(189998001)(6436002)(3660700001)(33656002)(66066001)(305945005)(74316002)(81166006)(14454004)(5660300001)(77096006)(8676002)(2906002)(75432002)(2900100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR06MB3090;H:BN6PR06MB3090.namprd06.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-transfer-encoding: quoted-printable X-OriginatorOrg: wisc.edu X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2017 17:28:50.8927 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 2ca68321-0eda-4908-88b2-424a8cb4b0f9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR06MB3090 X-SW-Source: 2017-q3/txt/msg00022.txt.bz2 I understand your argument. Since I was doing: =20=20=20 dwarf_getsrclines(&cuDIE, &lineBuffer, &lineCount) dwarf_getsrcfiles(&cuDIE, &files, &filecount) I knew they were related because I used the same DIE. But someone trying to= use a function which returns only the index could be confusing about what = Dwarf_Files it came from.=20 But, with extern int * dwarf_line_files (Dwarf_Line *line, Dwarf_Files **files, size_t *idx); they would know what Dwarf_Files the line is related to. For me, though, I = could pass NULL for files, since I already knew what it is. From: Mark Wielaard Sent: Monday, July 17, 2017 8:04 AM To: Sasha Da Rocha Pinheiro Cc: elfutils-devel@sourceware.org Subject: Re: File index given line (libdw) =A0=20=20=20 On Mon, 2017-07-17 at 04:10 +0000, Sasha Da Rocha Pinheiro wrote: > [Resending cause it seems it didn't go] Probably because it had an HTML attachement. The mailinglist rejects emails with HTML. > You understood what I need when you said: > "So you want to keep a vector with filenames for a particular CU. And > then given Dwarf_Lines you want to associate each Dwarf_Line with a > particular filename from that vector." >=20 > I agree with this "But currently that is an implementation detail. " > But I don't see why this would change. Deliberately sort the files > names so it doesn't match with the lines? I don't think so. But newer versions of DWARF could have a different way of sharing the source files or directory table between CUs. The issue is that the index from the Dwarf_Lines only makes sense if you know which CU the corresponding Dwarf_Files came from. So instead of providing the relationship between a Dwarf_Line and a Dwarf_File I rather would not depend on something indirect like the index into some Dwarf_Files table. If we do provide it then I think we should be explicit about what it is an index into. So maybe a function like: extern int * dwarf_line_files (Dwarf_Line *line, Dwarf_Files **files, size_t *idx); Where files and idx are returned in a way that make them useful with dwarf_filesrc. Would the above be helpful for your usecase? Cheers, Mark =20=20=20=20