unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: egnarts-ms <egnartsms@gmail.com>
Cc: Emacs-devel@gnu.org
Subject: Re: Edebug & lexical scope
Date: Fri, 18 May 2012 15:54:49 -0400	[thread overview]
Message-ID: <jwvehqh8e4r.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <33870303.post@talk.nabble.com> (egnarts-ms's message of "Fri, 18 May 2012 06:30:00 -0700 (PDT)")

> 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).


        Stefan



  reply	other threads:[~2012-05-18 19:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18 13:30 Edebug & lexical scope egnarts-ms
2012-05-18 19:54 ` Stefan Monnier [this message]
2012-05-19  8:57   ` egnarts-ms
2012-05-19 18:51     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvehqh8e4r.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=Emacs-devel@gnu.org \
    --cc=egnartsms@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).