[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: When calling defuns is a Bad Thing.
From: |
Alan Mackenzie |
Subject: |
Re: When calling defuns is a Bad Thing. |
Date: |
Mon, 22 Oct 2018 14:06:38 +0000 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
Hello, Stefan.
On Sun, Oct 21, 2018 at 14:07:18 -0400, Stefan Monnier wrote:
> > Calling defuns (as opposed to primitives) from edebug is a bad idea,
> > unless those defuns are also defined in edebug.el.
> Just as a datapoint, I remember using Edebug to debug itself, and
> it was very useful to be able to do it (although it's clearly
> problematic in the general case).
> So, I partly agree, but I also think maybe we should try and work to
> make it easier to Edebug any code, even the one used by Edebug.
I hacked up some analysis code (something which you surely have as a
nicely parameterised macro ;-) and found 50 "external" defuns called by
edebug.el, most of them, surely, in the non-engine parts. Indeed, one
of them is sit-for, which I can vaguely remember edebugging in the past,
so yes, things aren't as bad as I initially thought.
There are, by the way, twelve "external" macros called, ranging all the
way from cl-defstruct to pcase-dolist to cl-letf*. Most, if not all, of
these are surely "harmless", in that either they're used in non-critical
parts of edebug.el, or they don't generate calls to defuns in their
expansions.
So, I now agree with your initial assessment, there's probably nothing
much to worry about here, but I intend to explore further, and see if I
can crash/hang Emacs by using edebug.
One thing that could be done is to put a `no-edebug' property on symbols
whose function mustn't be instrumented (such as edebug-slow-after), but
that seems somewhat excessive, unless we find a real problem.
> Stefan
--
Alan Mackenzie (Nuremberg, Germany).