armedbear / abcl

Armed Bear Common Lisp <git+https://github.com/armedbear/abcl/> <--> <svn+https://abcl.org/svn> Bridge
https://abcl.org#rdfs:seeAlso<https://gitlab.common-lisp.net/abcl/abcl>
Other
291 stars 29 forks source link

Documentation: "inability to inspect local variables in a given call frame" #619

Closed fosskers closed 1 year ago

fosskers commented 1 year ago

I was reading through the manual and noticed this point in Section 1.1.2, Contemporary Common Lisp:

An incomplete implementation of interactive debugging mechanisms, namely a no-op version of STEP6, the inability to inspect local variables in a given call frame, and the inability to resume a halted computation at an arbitrarily selected call frame

In particular it states the inability to inspect local variables in a given call frame, and yet I am able to inspect local bindings in all the available stack frames while in the interactive debugger. Am I misunderstanding the original wording?

Cheers!

alejandrozf commented 1 year ago

Do you mean using Slime or the plain REPL? How are you doing it?

With Slime I can see arguments of the functions called but not for local variables, for example

For this function:

image

I got this when calling with (test2 7):

image but with no way to get the value of the variable b

In the plain REPL I saw options for inspect the value but they are not working for local bindings.

I didn't tried with abcl-instrospect, maybe using it is possible to inspect all local bindings.

On the other hand, there is a contrib for a working stepper called abcl-stepper (I'm the author) which allows to get the values of local bindings among other features. Maybe the documentation needs to be updated in that paragraph to mention it.

fosskers commented 1 year ago

Now that I'm testing it in SBCL, I'm actually seeing the same thing; I can't manage to get access to b within the debugger.

However, the good news is that Sly Stickers do work, so if I really need access to an inner variable, I can use those.

I think the original issue can be closed. Thanks!

alanruttenberg commented 1 year ago

@fosskers Have you tried to look at frames of functions that are interpreted? With ABCL-introspect those should be visible.

fosskers commented 1 year ago

It was the same result for either interpreted or compiled functions, although I was just using what Sly provides by default. I didn't try out abcl-introspect.

alanruttenberg commented 1 year ago

Right, it won't work unless abcl-introspect is loaded. Also, I'm not familiar with sly. Slime has the debugger support for this.