Edebug

Edebug is a source-level debugger for Emacs Lisp programs, with which you can:

The first three sections below should tell you enough about Edebug to start using it.

Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
https://www.gnu.org/software/emacs/manual/html_node/elisp/Edebug.html