From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Proposal: stack traces with line numbers Date: Sun, 15 Oct 2017 12:20:50 -0400 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1508084484 22621 195.159.176.226 (15 Oct 2017 16:21:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 15 Oct 2017 16:21:24 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 15 18:21:21 2017 Return-path: Envelope-to: ged-emacs-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 1e3lf2-0003lH-LJ for ged-emacs-devel@m.gmane.org; Sun, 15 Oct 2017 18:21:08 +0200 Original-Received: from localhost ([::1]:57779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3lfA-0003BL-1i for ged-emacs-devel@m.gmane.org; Sun, 15 Oct 2017 12:21:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3lf4-0003BE-66 for emacs-devel@gnu.org; Sun, 15 Oct 2017 12:21:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3lf1-000897-1y for emacs-devel@gnu.org; Sun, 15 Oct 2017 12:21:10 -0400 Original-Received: from [195.159.176.226] (port=40079 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3lf0-00085K-Qd for emacs-devel@gnu.org; Sun, 15 Oct 2017 12:21:06 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1e3lem-0001nF-Ud for emacs-devel@gnu.org; Sun, 15 Oct 2017 18:20:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:mIrVziWcpvnX82C3IOuJBX4G7Vw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219550 Archived-At: > Unless you care about interpreted code, a non-weak hash-table should be > enough. Some of the position info might need to be preserved "indefinitely", so only a weak hash-table would handle that right (of course, an alternative would be to store the position directly in the return value of `read`, e.g. as is done in edebug-read-storing-offsets). >> - I'm storing the information in vectors because it seems like a >> reasonably efficient use of memory. [...] > It's debatable whether a [file line column] vector is an efficent > representation. E.g. all lists in a source form come from the same file > (or buffer or string) so storing the same filename many times seems > redundant. After macro-expansion, the source code can be made of pieces coming from different files. > So, I think the reader should, at least optionally, also record > positions of every cons cell not just the first in a list. The macro expansion code will need to be changed to propagate the source info from the call to the expansion, and I think that should be sufficient to make it unnecessary to preserve info about cons cells in cdr position. Stefan