1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

api-debug.texi updates

* doc/ref/api-debug.texi (Debugging, Evaluation Model)
  (Source Properties): Fixes.
This commit is contained in:
Andy Wingo 2010-09-24 18:04:05 +02:00
parent 3e2c5f1ef3
commit a1652dec10

View file

@ -10,8 +10,8 @@
@cindex Debugging @cindex Debugging
In order to understand Guile's debugging facilities, you first need to In order to understand Guile's debugging facilities, you first need to
understand a little about how Guile represent the Scheme control stack. understand a little about how Guile represent the Scheme control stack.
With that in place we explain the low level trap calls that the With that in place we explain the low level trap calls that the virtual
evaluator can be configured to make, and the trap and breakpoint machine can be configured to make, and the trap and breakpoint
infrastructure that builds on top of those calls. infrastructure that builds on top of those calls.
@menu @menu
@ -28,8 +28,8 @@ The idea of the Scheme stack is central to a lot of debugging. The
Scheme stack is a reified representation of the pending function returns Scheme stack is a reified representation of the pending function returns
in an expression's continuation. As Guile implements function calls in an expression's continuation. As Guile implements function calls
using a stack, this reification takes the form of a number of nested using a stack, this reification takes the form of a number of nested
stack frames, each of which has the procedure and its arguments, along stack frames, each of which corresponds to the application of a
with local variables and temporary values. procedure to a set of arguments.
A Scheme stack always exists implicitly, and can be summoned into A Scheme stack always exists implicitly, and can be summoned into
concrete existence as a first-class Scheme value by the concrete existence as a first-class Scheme value by the
@ -53,10 +53,10 @@ function will not be on the stack, as it has no work left to do.
Therefore, when an error occurs in a running program, or the program Therefore, when an error occurs in a running program, or the program
hits a breakpoint, or in fact at any point that the programmer chooses, hits a breakpoint, or in fact at any point that the programmer chooses,
its state at that point can be represented by a @dfn{stack} of all the its state at that point can be represented by a @dfn{stack} of all the
evaluations and procedure applications that are logically in progress at procedure applications that are logically in progress at that time, each
that time, each of which is known as a @dfn{frame}. The programmer can of which is known as a @dfn{frame}. The programmer can learn more about
learn more about the program's state at that point by inspecting the the program's state at that point by inspecting the stack and its
stack and its frames. frames.
@menu @menu
* Capturing the Stack or Innermost Stack Frame:: * Capturing the Stack or Innermost Stack Frame::
@ -76,7 +76,7 @@ describes the Scheme stack at that point.
@lisp @lisp
(make-stack #t) (make-stack #t)
@result{} @result{}
#<stack 805c840:808d250> #<stack 25205a0>
@end lisp @end lisp
@deffn {Scheme Procedure} make-stack obj . args @deffn {Scheme Procedure} make-stack obj . args
@ -206,20 +206,18 @@ can be seen by typing @code{(xxx)} and @code{xxx} at the Guile prompt
(where the variable @code{xxx} has not been defined): (where the variable @code{xxx} has not been defined):
@example @example
guile> (xxx) scheme@@(guile-user)> (xxx)
standard input:2:1: In expression (xxx): <unnamed port>:4:1: In procedure module-lookup:
standard input:2:1: Unbound variable: xxx <unnamed port>:4:1: Unbound variable: xxx
ABORT: (unbound-variable)
guile> xxx scheme@@(guile-user)> xxx
<unnamed port>: In expression xxx: ERROR: In procedure module-lookup:
<unnamed port>: Unbound variable: xxx ERROR: Unbound variable: xxx
ABORT: (unbound-variable)
@end example @end example
@noindent @noindent
In the latter case, no source properties were stored, so the best that In the latter case, no source properties were stored, so the error
Guile could say regarding the location of the problem was ``<unnamed doesn't have any source information.
port>''.
The recording of source properties is controlled by the read option The recording of source properties is controlled by the read option
named ``positions'' (@pxref{Reader options}). This option is switched named ``positions'' (@pxref{Reader options}). This option is switched