From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: GSoC project - Improving ELisp Traceback and Debugging Information Date: Sat, 06 Jun 2020 21:56:41 +0200 Message-ID: References: <87eeqv6d30.fsf@gmail.com> <878sh0rr7m.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="10498"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Zach Shaftel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 06 21:57:19 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jhewQ-0002b4-SL for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Jun 2020 21:57:18 +0200 Original-Received: from localhost ([::1]:52098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhewP-0001bi-Rx for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Jun 2020 15:57:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhevv-00015S-9A for emacs-devel@gnu.org; Sat, 06 Jun 2020 15:56:47 -0400 Original-Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:37802) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhevu-0004f9-6T for emacs-devel@gnu.org; Sat, 06 Jun 2020 15:56:47 -0400 Original-Received: by mail-ed1-x52d.google.com with SMTP id k8so10175578edq.4 for ; Sat, 06 Jun 2020 12:56:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=XBneQ6gaF4nrcwPxvpmiFu9fJREWCb4fFDUwE/lgCyI=; b=Xznvh8a+5xaQp85iXNBsABH9rIn5zfAbLaFwvypQ/GcwGWQo5G+W56rwZVjVcZWRY+ THRfASWzUSKbZyx1PBWzt80bCPlEvvsfRMo3G/AIoyg1Wgmf71Q73JyoUFthZHF+a+Eh 1iQa8o77qNwtpVB9UoHTKAl2LVVUJmBBkQ/ssDlQgcyHLfhOtBVF3ltr1A820evfsXGt yzjz2X3GIG5r09hj6i6zT9ahCf5wpOSHnMdcjdGCyCub9178QYEmU9sKROpmZbDMm7e9 6AX+gLynWk8oT8P/55XLu89vq74QXI/auMwoftxBxbUFjXztVs1gr+4YNJwqjjoxEg3U EiRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=XBneQ6gaF4nrcwPxvpmiFu9fJREWCb4fFDUwE/lgCyI=; b=o8EnTzgnBVqD8B62AZD76m+qCiSMnDTTctHVnQz0Wsy3QM/tMF+1VxBDKCBwCNFvm+ XGcT52RsFg6/uHSFjvpL7L5sI/TuS+xNkrVuCkTNv8+7i7Rq/u34cBvrFzj+dYHHnusu VFcNT2CFYYifx5y6ZLwjfhgtm28Th3L0c1p5ce6xFOnRLBcWIaFge2EGL+/P7d2A0ZGU n2DBSoSZ+qgMjOlWHuDRHfnxIiJZdn7C6PvXQxudP/Zfej1JIgE1kM34SeMib6M1EwOK fDDFmTa2Amp92iOrUv2ELRW4M5htH4lSQK9FqwJwhtu6cGzS+/jHtmgnnHF0H6ks/VCR IOiQ== X-Gm-Message-State: AOAM5319A2p4h0I6pAStXhqX3krDJ5EPLMj3tLEEVCj9phd6G2sk9hgY U6WpC4VV4Xf/Xt8W8hYL/f+g3+Eq X-Google-Smtp-Source: ABdhPJwdOqrG+xIRjKLlQTa2fzk5aWa7Ri942VPULxMXRUJJj1rwacX3FwqqJlGZiGxPzcOevqp1yA== X-Received: by 2002:aa7:d9d6:: with SMTP id v22mr15759751eds.66.1591473404061; Sat, 06 Jun 2020 12:56:44 -0700 (PDT) Original-Received: from caladan (dialin-242027.rol.raiffeisen.net. [195.254.242.27]) by smtp.gmail.com with ESMTPSA id ce14sm7078261ejc.3.2020.06.06.12.56.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jun 2020 12:56:43 -0700 (PDT) In-Reply-To: <878sh0rr7m.fsf@gmail.com> (Zach Shaftel's message of "Sat, 06 Jun 2020 14:20:46 -0400") Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=eller.helmut@gmail.com; helo=mail-ed1-x52d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:251964 Archived-At: > I'll be looking at how other Lisp compilers record source code > locations. SBCL is what I'm most familiar with but that compiler is > very > complex, and uses an intermediate code representation during > compilation > that makes recording this type of information easier. [For now lets pretend that "source-path" is the same as a source-location.] Before converting to IR1, SBCL records the "source-path" of each cons cell in a top-level form in the hash table *SOURCE-PATHS*. (See the function SUB-FIND-SOURCE-PATHS defined in ir1tran.lisp). Later, when the compiler walks down the (macroexpanded) form, it searches the recorded source-path for the current form. If something is recorded, good; if nothing is recorded, then the compiler uses the source-path of the parent form instead (the top-level form has always a recorded source-path). I think this approach is quite simple and usually works pretty well. Most macros return part of the input arguments somewhere in their output and so the compiler will naturally find the recorded source-path in the hash table. Problematic are macros that completely copy/rewrite the input. Luckily, such macros are rare. I don't know if it would work well enough for macroexpand-all and cconv.el. But at least, it doesn't need new data types. It could also help to manually propagate the source locations in a few places, like macroexp--cons. Helmut