Subject: bug#16184: 24.3.50; edebug and eval-when-compiler don't work together

From: Gemini Lasswell <[email-masked]>
Date: Fri, 30 Dec 2016 15:27:37 -0800

Alan Mackenzie <[email-masked]> writes:

>
> .  During this instrumentation, the inside of the cc-eval-when-compile
> form gets run, in particular, the (edebug-before 2).  At this stage,
> since edebug-enter hasn't been run at all, edebug-offset-indices is still
> nil.  The (edebug-before 2) thus attempts (setcar nil 2), which throws
> the error.
>

I haven't able to reproduce the bug with cc-eval-when-compile,
just eval-and-compile. But the thing that is supposed to make Edebug
wrap a form in edebug-enter is the use of def-form or def-body in the
Edebug spec. It works for eval-when-compile which has the Edebug spec
(&rest def-form). The body of eval-and-compile doesn't get wrapped
because its Edebug spec is t, so the bug happens there.

cc-eval-when-compile has the same Edebug spec as eval-when-compile, so
its body should get wrapped by edebug-enter. If that's not happening in
your Emacs, it's a bug in Edebug which is different from the
eval-and-compile Edebug spec bug.