From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113413 invoked by alias); 15 Jul 2017 01:22:59 -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 112554 invoked by uid 89); 15 Jul 2017 01:22:59 -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.1 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.1 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; Sat, 15 Jul 2017 01:22:57 +0000 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII 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 <0OT300800Y3B4900@smtpauth3.wiscmail.wisc.edu> for elfutils-devel@sourceware.org; Fri, 14 Jul 2017 20:22:55 -0500 (CDT) X-Spam-Report: AuthenticatedSender=yes, SenderIP=216.32.181.178 X-Spam-PmxInfo: Server=avs-3, Version=6.3.3.2656215, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2017.7.15.11516, AntiVirus-Engine: 5.38.0, AntiVirus-Data: 2017.6.21.5380002, SenderIP=216.32.181.178 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01lp0178.outbound.protection.outlook.com [216.32.181.178]) by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 8.0.1.1.0 64bit (built Jun 15 2016)) with ESMTPS id <0OT300BJMYI69B30@smtpauth3.wiscmail.wisc.edu>; Fri, 14 Jul 2017 20:22:55 -0500 (CDT) Received: from DM2PR06MB272.namprd06.prod.outlook.com (10.141.100.154) by DM2PR06MB269.namprd06.prod.outlook.com (10.141.100.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1240.13; Sat, 15 Jul 2017 01:22:53 +0000 Received: from DM2PR06MB272.namprd06.prod.outlook.com ([fe80::297f:6a7e:3019:1c34]) by DM2PR06MB272.namprd06.prod.outlook.com ([fe80::297f:6a7e:3019:1c34%27]) with mapi id 15.01.1240.020; Sat, 15 Jul 2017 01:22:53 +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+vQz Date: Sat, 15 Jul 2017 01:22:00 -0000 Message-id: References: <1499937069.14595.215.camel@klomp.org> <1500026625.14595.238.camel@klomp.org> In-reply-to: <1500026625.14595.238.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;DM2PR06MB269;7:9XcMNFjr+qnuJhHsRVWwpWuQKjL259c5t5b9auFn5s+djEKkW/D9XDOS00RGc91A3w7d+fP0qy29xSfp/7GzuXLz9W5pRjiZfgxGuU99zWx/z3z2W8gPeJROAoopgL5eCX91kno9m2u2k1rZ2ezkb2JnW0pPonljaP/8sqN6uZFrAexWd5YmVwGuNOHI3jVyKS19/GtS92zA+U1ZV0REGv0kLFevvq3ndrKbVtaimaGlDs/8DGh3gpaQedOF+jR6XbR6Je7P7lY32pa7Y3XSx0oNcifjyns/AUuP+XSrvkqV6iVkDTL1dqNyzVe2HPbBhy53y+jsLAhSiLWjTNB19ud01DM7A6+TBhjUkAcq8ftn0KCNyZaP+Xcfs3NVyjg6s+5H20uD2BDQwmzjkST4amvubNX1A7Qn02AcdEJoHJJy50nabgasemIqUUiyTlUoZ7u1S8jcevPRaVoovs/Vyr+/yXHAdBUX/r/yio4s1lwPKvWIBx0RIGhgnhI9z0BgfI/VnQ6YFDYZhGJ2VMlO+NCjsJkIrmXexKBHrdZr/5rStGXbwf9wlXkCF1o4QmZpyy4fN1SqZBP0YwNbSZmrNkHUsIr/AiE7wW2VpT156JTzsHci6qabPob/zBfxX74RiaKul57556BL6BYTPoL7hb8E0r7GCJKcH6ttFH7r26/nAZm2t+UVO1D5DQOfOPKucHdtVsPN2WBTIMVT1xl2hUkGPzwCbMVt99FmhhmmIPNJBpsjNURJP7SY6UzA0shMLgjHPC6Fhy0s2gDZLtL39j1aop9mTj41jJ5zPlorfH8= x-ms-office365-filtering-correlation-id: 83ce700f-e5b2-4816-a703-08d4cb20041f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(48565401081)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM2PR06MB269; x-ms-traffictypediagnostic: DM2PR06MB269: x-exchange-antispam-report-test: UriScan:(236129657087228)(148574349560750); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(2017060910075)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201702281529075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123558100)(20161123562025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM2PR06MB269;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM2PR06MB269; x-forefront-prvs: 0369E8196C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39450400003)(39400400002)(39850400002)(39410400002)(39860400002)(39840400002)(54356999)(6246003)(102836003)(9686003)(93886004)(6916009)(6116002)(8676002)(2950100002)(86362001)(6506006)(189998001)(76176999)(75432002)(50986999)(229853002)(99286003)(478600001)(3846002)(55016002)(5660300001)(305945005)(110136004)(66066001)(53936002)(7696004)(14454004)(74316002)(7736002)(3280700002)(88552002)(4326008)(2900100001)(38730400002)(3660700001)(33656002)(5250100002)(81166006)(8936002)(6436002)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR06MB269;H:DM2PR06MB272.namprd06.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM X-OriginatorOrg: wisc.edu X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jul 2017 01:22:53.3565 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 2ca68321-0eda-4908-88b2-424a8cb4b0f9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR06MB269 X-SW-Source: 2017-q3/txt/msg00010.txt.bz2 Hi Mark, >But why do you want to do that? Performance and save memory space. >If we would add int dwarf_line_index (Dwarf_Line *line, size_t *idx) how >exactly would you use it? I would get idx and save it in my data structure so I don't have to save the file name repeatedly for each line. >What would be a good testcase for this new functionality? This new function would behave similar to: int dwarf_lineno (Dwarf_Line *line, int *linep) { if (line == NULL) return -1; *linep = line->line; return 0; } But would get line->file instead of line->line; This way, since I already got the files previously, I now can refer to some line file source by its id. >A small example program would help to see what the exact semantics >should be. How it's currently being done : 1. Dwarf_Files dfs <- dwarf_getsrcfiles 2. for each file in dfs get name (with dwarf_filesrc) -> save in vector filenames 3. Dwarf_Lines dls <- dwarf_getsrclines 4. for each line in dls get file name and "search this name in vector filenames" We want to eliminate the "search this name in vector filenames", to make it from L F log(F) to L, by getting the index and consulting the file name of a line in the vector filenames directly. Regards, Sasha