[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to highlight the offending line of code with edebug
From: |
Eli Zaretskii |
Subject: |
Re: How to highlight the offending line of code with edebug |
Date: |
Fri, 23 Dec 2022 10:39:50 +0200 |
> From: Michael Welsh Duggan <mwd@md5i.com>
> Cc: emacs-devel@gnu.org
> Date: Fri, 23 Dec 2022 02:36:15 -0500
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> How do I invoke the edebug debugger when you get an error:
> >
> > I don't think you can. Edebug requires that you instrument the
> > function(s) you want to debug in advance.
>
> An approach to this is to use `M-x toggle-debug-on-error` and then run
> the offending command. That will get you a backtrace with which you can
> determine what function it is actually failing within. Then you can
> instrument that function with edebug, toggle debug-on-error again, and
> run again.
Yes, that's what everyone does. But note that even after
instrumenting the offending function, there's AFAIK no way of asking
Edebug to kick in only when the error happens. Instead, you need to
step through the function and see where it signals an error.