Shammer's Philosophy

My private adversaria

ClozureCL Debugger :R

When compiling lisp source code based on the ClozureCL, some error happened by miss-coding.
At that time, the following message like below output.

> Error: There is no package named "CORE-CONSTANT" .
> While executing: CCL::%PARSE-TOKEN, in process listener(1).
> Type :GO to continue, :POP to abort, :R for a list of available restarts.
> If continued: Retry finding package with name "CORE-CONSTANT".
> Type :? for other options.
1 >

In this case, error was thrown when finding package named core-constant, but there is no package such name. But, I would like to know the code which includes to access the package named "CORE-CONSTANT". There is no information like that, but it is very useful.

This error message indicates that :? shows the help. Try this.

1 > :?
The following toplevel commands are available:
 <n>    the same as (:C <n>)
 (:FUNCTION FRAME-NUMBER)  Returns the function invoked in backtrace frame <frame-number>.  This may be useful for, e.g., disassembly
 (:FORM FRAME-NUMBER)  Return a form which looks like the call which established the stack frame identified by <frame-number>.  This is only well-defined in certain cases: when the function is globally named and not a lexical closure and when it was compiled with *SAVE-LOCAL-SYMBOLS* in effect.
 (:SET-LOCAL NAME FRAME-NUMBER NEW)  Set value of argument denoted <name> (see :LOCAL) in frame <frame-number> to value <new>.
 (:LOCAL NAME FRAME-NUMBER)  Return value of local denoted by <name> in frame <frame-number> <name> can either be a symbol - in which case the most recent
binding of that symbol is used - or an integer index into the frame's set of local bindings.
 (:SET-ARG NAME FRAME-NUMBER NEW)  Set value of argument named <name> in frame <frame-number> to value <new>.
 (:ARG NAME FRAME-NUMBER)  Return value of argument named <name> in frame <frame-number>
 (:V N FRAME-NUMBER)  Return value <n> in frame <frame-number>
 (:RAW N)  Show raw contents of backtrace frame <n>
 (:APPLY-IN-FRAME I FUNCTION &REST ARGS)  Applies FUNCTION to ARGS in the execution context of the Ith stack frame
 (:RETURN-FROM-FRAME I &REST VALUES)  Return VALUES from the I'th stack frame
 (:F N)  Show backtrace frame <n>
 (:C &OPTIONAL N)  Choose restart <n>. If no <n>, continue
 (:B &KEY START COUNT SHOW-FRAME-CONTENTS)  backtrace
 :NFRAMES   print the number of stack frames accessible from this break loop
 :R     list restarts
 :Q     return to toplevel
 :GO    continue
 :A     exit current break loop
 :POP   exit current break loop
 :?     help
 :PWD   Print the pathame of the current directory
 (:CD DIR)  Change to directory DIR (e.g., #p"ccl:" or "/some/dir")
 (:PROC &OPTIONAL P)  Show information about specified process <p>/all processes
 (:KILL P)  Kill process whose name or ID matches <p>
 (:Y &OPTIONAL P)  Yield control of terminal-input to process
whose name or ID matches <p>, or to any process if <p> is null
Any other form is evaluated and its results are printed out.
1 >

A lot of commands are exists. There are a lot of commands that sounds very useful. I tried :R command, and this shows like below.

1 > :R
>   Type (:C <n>) to invoke one of the following restarts:
0. Return to break level 1.
1. #<RESTART ABORT-BREAK #x20F3B0ED>
2. Retry finding package with name "CORE-CONSTANT".
3. Find specified package instead of "CORE-CONSTANT" .
4. Make "CORE-CONSTANT" be a nickname for package "CORE-HELPER".
5. Retry loading "helpers/core-helpers.lisp"
6. Skip loading "helpers/core-helpers.lisp"
7. Load other file instead of "helpers/core-helpers.lisp"
8. Retry loading "core.lisp"
9. Skip loading "core.lisp"
10. Load other file instead of "core.lisp"
11. Retry loading "build.lisp"
12. Skip loading "build.lisp"
13. Load other file instead of "build.lisp"
14. Skip loading "build.lisp"
15. Abort startup.
16. Reset this thread
17. Kill this thread
1 >

Oh, this tells me the information like stack trace. This let me know where is the wrong points in.
This is a great information. I use these commands more.