From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Fis Trivial Newsgroups: gmane.lisp.guile.devel Subject: How to record source properties for all symbols? Date: Sun, 3 Jun 2018 19:48:05 +0000 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1528055180 6940 195.159.176.226 (3 Jun 2018 19:46:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 3 Jun 2018 19:46:20 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Jun 03 21:46:16 2018 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPYxB-0001hO-C4 for guile-devel@m.gmane.org; Sun, 03 Jun 2018 21:46:14 +0200 Original-Received: from localhost ([::1]:36479 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPYzI-000739-44 for guile-devel@m.gmane.org; Sun, 03 Jun 2018 15:48:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPYz6-000732-MW for guile-devel@gnu.org; Sun, 03 Jun 2018 15:48:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPYz3-0007wt-EK for guile-devel@gnu.org; Sun, 03 Jun 2018 15:48:12 -0400 Original-Received: from mail-oln040092002042.outbound.protection.outlook.com ([40.92.2.42]:6233 helo=NAM01-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fPYz3-0007v7-2e for guile-devel@gnu.org; Sun, 03 Jun 2018 15:48:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1klNzeTcOfuMVbQJ29LPLUpXNTvJ/Dx8oo/FmfekAB0=; b=VNgG0Cptb9dRDDFRGfs/vrhLua/1Zg25P3wFK6rRYus18T9DBn+21uMshEtdQ0kKyXb5LatRvXcvTB/dDzYcfELBj+05nYyTcRA//j+7p3RiDeJRDcfYEnfBJK6kfr+3AcdGRQvMETJYP6yfcRuOnuffYQUspbqZcG2BMhmdQDBnbxNE911MB3apJLW2k+XzAgbJd12l00+Q9uvJSCRnNXOb/NsIXznoxm84Nyu1mN3FRTSycCzWj1fAPetKxb4JNhK9CP8wRHfzEhJ/hQxeMZUFHLnhlTdHOAWokwrBQrWHt3SqJsuubCa5jqeUWaGr9JetxrPKEVLSFO+dcUxy/w== Original-Received: from BY2NAM01FT017.eop-nam01.prod.protection.outlook.com (10.152.68.55) by BY2NAM01HT177.eop-nam01.prod.protection.outlook.com (10.152.69.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.841.10; Sun, 3 Jun 2018 19:48:06 +0000 Original-Received: from BLUPR16MB0500.namprd16.prod.outlook.com (10.152.68.53) by BY2NAM01FT017.mail.protection.outlook.com (10.152.69.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.820.8 via Frontend Transport; Sun, 3 Jun 2018 19:48:06 +0000 Original-Received: from BLUPR16MB0500.namprd16.prod.outlook.com ([fe80::55c2:9577:1f40:5c55]) by BLUPR16MB0500.namprd16.prod.outlook.com ([fe80::55c2:9577:1f40:5c55%2]) with mapi id 15.20.0820.015; Sun, 3 Jun 2018 19:48:06 +0000 Thread-Topic: How to record source properties for all symbols? Thread-Index: AQHT+3PKSmhw6AWrz0W889gK7Fr0tA== Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK2PR0302CA0016.apcprd03.prod.outlook.com (2603:1096:202::26) To BLUPR16MB0500.namprd16.prod.outlook.com (2a01:111:e400:c46a::11) x-incomingtopheadermarker: OriginalChecksum:722607E432A52598DF3A049EC1F6AA6631AE3ACF1FB83CEBD5DD54422FB42F5D; UpperCasedChecksum:565D3AD26037B6818828CEF276ECF86C21A54B4552CEC46EE2EF5FF236A60170; SizeAsReceived:7297; Count:47 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [phSzvBjaeQDjDDexFSk5krlN3VfLWcMKQYuS+oaSr4ZwD8dh/gkAyPcFe8NHTu5F] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BY2NAM01HT177; 7:56Yy4WViwWT5h7JN2hKTFbgOTQOZi5tmZn5NED536+VWTq2OnWUsrmmMsN+xW/hZMtH6f6zU69Y76kO6U2StG6im6BLKvCrSS4GXR2WewfhhK4xgsBNtDQDUPza+J3M2W4m9VSAS3QMXH7MKYB1sM+QkiYyC8bn8uAU6YuR95DyR3EJGvnnfa/oDDpRf7nYEB1ttscT3N43Mgt1K39it+3q9LM90An0z2lp0a+Hgg2BVKXOBq7xsc/ErzhzmcYBA x-incomingheadercount: 47 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101448)(1601125466)(1701031045); SRVR:BY2NAM01HT177; x-ms-traffictypediagnostic: BY2NAM01HT177: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:BY2NAM01HT177; BCL:0; PCL:0; RULEID:; SRVR:BY2NAM01HT177; x-forefront-prvs: 069255B8B8 x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(51874003)(189003)(199004)(33656002)(386003)(14454004)(6506007)(3280700002)(104016004)(7696005)(8676002)(102836004)(74316002)(73972006)(5660300001)(86362001)(5250100002)(3660700001)(87572001)(6916009)(55016002)(25786009)(68736007)(106356001)(6436002)(476003)(46003)(97736004)(20460500001)(8936002)(81156014)(6346003)(99286004)(305945005)(83332001)(105586002)(9686003)(486006)(82202002)(2900100001)(15852004); DIR:OUT; SFP:1901; SCL:1; SRVR:BY2NAM01HT177; H:BLUPR16MB0500.namprd16.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:; received-spf: None (protection.outlook.com: hotmail.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ybbs.daans@hotmail.com; x-microsoft-antispam-message-info: XyBq93rHyBiTCPgThldwpnEjv6Yv37INoxgrNRfkqdHN2i/0gdC/o8+c9M8mnHBCv+hLjp9Xizn3jci/Q6UM4gOT2ELSBP5On4lL+wPV5Rv0LuYPQeVWjCbOsndwJKTwaJKKyQenCrVFV7a4gP9munfPAX6GoHLHuD01wrMMxnTKVFM251MadHYqrUkBdSVJ X-MS-Office365-Filtering-Correlation-Id: fc4d11ad-023b-4c8b-4ed4-08d5c98aec27 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: dd759f05-a917-4aa0-a2f5-4cc35c50e0c8 X-MS-Exchange-CrossTenant-Network-Message-Id: fc4d11ad-023b-4c8b-4ed4-08d5c98aec27 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: dd759f05-a917-4aa0-a2f5-4cc35c50e0c8 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2018 19:48:05.9972 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2NAM01HT177 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.92.2.42 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:19540 Archived-At: Hi, guiles. I'm new to scheme and guile. Most of the time, I am a c/c++ and python programmer. One thing that bugs me about writing scheme with guile is that I can't have full source information when reading backtrace. For example, in the following snippet (test.scm): ---------------- (use-modules (ice-9 pretty-print)) (define (function) (format #t "function")) (define* (function-asterisk) (format #t "asterisk")) (format #t "function properties:~a~%" (source-properties function)) (format #t "asterisk properties:~a~%" (source-properties function-asterisk)= ) (define var "normal var") (format #t "normal var properties:~a~%" (source-properties var)) ---------------- With guile-2.2.3, running $guile ./test.scm , I got the following result: ---------------- function properties:() asterisk properties:() normal var properties:((line . 9) (column . 12) (filename . /home/fis/Other= s/git-repos/compliers/guile/./test.scm)) ---------------- In which you can see, only `var' has non-empty source-properties. Further, if I enter the above snippet in guile shell, then source-properties is not recorded even for `var'. I tried to dig in the source code of guile, so far I have found two related functions: `scm_primitive_load' in load.c `maybe_annotate_source' in read.c. Using gdb to break on these two function doesn't stop the process. Only running (primitive-load "test.scm") inside guile shell invoke these two functions. The finding is far away from knowing how to make guile record source information for every symbols. Can you give me some guidance for how to achieve the goal(record all source information for every symbol). If it's theoretically impossible or hard to achieve, can you give me some inside why and advises for making best effort? I intend to help, so pointers to internal structures are also welcomed. Thanks in advance.