[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Edebug & lexical scope

From: Stefan Monnier
Subject: Re: Edebug & lexical scope
Date: Fri, 18 May 2012 15:54:49 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

> Currently (Emacs 24.0.97) Edebug cannot evaluate lexical variables when it
> is suspended (by "e" or "M-:").

Indeed.  The same holds for the normal (backtrace-style) debugger.

> It seems that I've managed to make M-: evaluate lexical variables.  I've
> created the following C subroutine; it does the same job as `eval', but
> first of all it scans "specpdl" (the stack of bindings of symbols) searching
> for the most recent value of Qinternal_interpreter_environment which is not
> eq to nil.

Thanks.  This is a good way to fix the problem (tho it still doesn't
solve the issue for the case of the normal debugger where you want to
look at the local variable of a lexical-binding byte-code routine,
because in that case the var names are purely gone).

The only problem with it is that it relies on all the stack frames (until
the interesting ones) using dynamic binding.  E.g. if/when we switch
edebug to lexical-binding we'll have a problem.

Also in the case of the normal debugger, we would generally want to be
able to get the value of a variable in a particular stack frame.

So it would be better to have an "eval-in-frame" which receives some
description of the stack frame to use (and of course, more primitives to
get a handle of the current stack frame as well as the Nth previous one).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]