• Clément Pit--Claudel's avatar
    Move backtrace to ELisp using a new mapbacktrace primitive · 27cada03
    Clément Pit--Claudel authored
    * src/eval.c (get_backtrace_starting_at, backtrace_frame_apply)
    (Fmapbacktrace, Fbacktrace_frame_internal): New functions.
    (get_backtrace_frame, Fbacktrace_debug): Use `get_backtrace_starting_at'.
    * lisp/subr.el (backtrace--print-frame): New function.
    (backtrace): Reimplement using `backtrace--print-frame' and `mapbacktrace'.
    (backtrace-frame): Reimplement using `backtrace-frame--internal'.
    * lisp/emacs-lisp/debug.el (debugger-setup-buffer): Pass a base to
    `mapbacktrace' instead of searching for "(debug" in the output of
    * test/lisp/subr-tests.el (subr-test-backtrace-simple-tests)
    (subr-test-backtrace-integration-test): New tests.
    * doc/lispref/debugging.texi (Internals of Debugger): Document
    `mapbacktrace' and missing argument BASE of `backtrace-frame'.
subr-tests.el 11.9 KB