]> git.eshelyaron.com Git - emacs.git/commitdiff
Add links in backtraces to functions written in C (bug#25393)
authorGemini Lasswell <gazally@runbox.com>
Mon, 25 Jun 2018 20:23:03 +0000 (13:23 -0700)
committerGemini Lasswell <gazally@runbox.com>
Fri, 3 Aug 2018 15:53:02 +0000 (08:53 -0700)
* lisp/emacs-lisp/backtrace.el (backtrace--print-func-and-args):
Look up file names for built-in functions with evaluated arguments.

lisp/emacs-lisp/backtrace.el

index d6c04bb4c67f34d85c5772ee497aec0ac368c9a7..bec57f29245bb0d4c1d10ae4313a3ecc0d3683e4 100644 (file)
@@ -651,7 +651,11 @@ Format it according to VIEW."
          (evald (backtrace-frame-evald frame))
          (fun   (backtrace-frame-fun frame))
          (args  (backtrace-frame-args frame))
-         (fun-file (symbol-file fun 'defun))
+         (def   (and (symbolp fun) (fboundp fun) (symbol-function fun)))
+         (fun-file (or (symbol-file fun 'defun)
+                            (and (subrp def)
+                                 (not (eq 'unevalled (cdr (subr-arity def))))
+                                 (find-lisp-object-file-name fun def))))
          (fun-pt (point)))
     (cond
      ((and evald (not debugger-stack-frame-as-list))