From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: backtrace-mode Date: Wed, 20 Jun 2018 07:52:07 +0200 Message-ID: References: <871sd2mli3.fsf@runbox.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1529473864 5707 195.159.176.226 (20 Jun 2018 05:51:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 20 Jun 2018 05:51:04 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Gemini Lasswell To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 20 07:51:00 2018 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 1fVW1E-0001Kx-7X for ged-emacs-devel@m.gmane.org; Wed, 20 Jun 2018 07:51:00 +0200 Original-Received: from localhost ([::1]:46177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVW3G-0004Nl-V8 for ged-emacs-devel@m.gmane.org; Wed, 20 Jun 2018 01:53:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVW2V-0004Nd-9U for emacs-devel@gnu.org; Wed, 20 Jun 2018 01:52:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVW2S-0003AM-1M for emacs-devel@gnu.org; Wed, 20 Jun 2018 01:52:19 -0400 Original-Received: from [195.159.176.226] (port=50449 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVW2R-00039h-RK for emacs-devel@gnu.org; Wed, 20 Jun 2018 01:52:15 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fVW0H-0000LD-T9 for emacs-devel@gnu.org; Wed, 20 Jun 2018 07:50:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:jCzxxKYIBG/Y1hjk8LOatP1EmfQ= 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:226546 Archived-At: On Tue, Jun 19 2018, Gemini Lasswell wrote: > - Now that xref-find-definitions works in backtrace buffers, I think > it would be better to stop making buttons for the functions in a > backtrace, and to document M-. as the best way to jump to function > definitions from backtraces. What do you think of this change to > existing behavior, with or without a new customization variable to > preserve the old behavior? Apparently M-. in this backtrace-mode uses the elisp backend. While that works, a backtrace-frame has potentially more context than just the name of a global function. E.g. I have a custom "view source" command that looks at the next frame and tries to find the function called inside the function source. That works pretty well as long as there aren't too many macros or lambdas involved. Also the compiler could potentially emit debug information to map the frame's PC to the source position; which would be very useful for lambdas. So I think there should either be a proper "view source" command or xref backend for backtraces. Another issue: backtrace-get-frames seems to compute the entire backtrace and all possibly relevant information in advance. Maybe that should be done a bit more lazily, e.g. compute the next N frames only if somebody needs them. For local variable also keep in mind that backtrace--locals is implemented rather inefficiently. That would also be less problematic if locals are only fetched when needed. Helmut