Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
2e4e1a20
Commit
2e4e1a20
authored
16 years ago
by
rtoy
Browse files
Options
Downloads
Patches
Plain Diff
Add a new section giving some examples of tracing.
parent
935f69d9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/cmu-user/debugger.tex
+44
-2
44 additions, 2 deletions
docs/cmu-user/debugger.tex
with
44 additions
and
2 deletions
docs/cmu-user/debugger.tex
+
44
−
2
View file @
2e4e1a20
...
@@ -1111,8 +1111,6 @@ function entry or exit.
...
@@ -1111,8 +1111,6 @@ function entry or exit.
\cpsubindex
{
errors
}{
breakpoints
}
\cpsubindex
{
errors
}{
breakpoints
}
\cindex
{
function-end breakpoints
}
\cindex
{
function-end breakpoints
}
\cpsubindex
{
breakpoints
}{
function-end
}
\cpsubindex
{
breakpoints
}{
function-end
}
\kwd
{
condition
}
,
\kwd
{
break
}
and
\kwd
{
print
}
forms are evaluated in
\kwd
{
condition
}
,
\kwd
{
break
}
and
\kwd
{
print
}
forms are evaluated in
the lexical environment of the called function;
\code
{
debug:var
}
and
the lexical environment of the called function;
\code
{
debug:var
}
and
...
@@ -1214,6 +1212,50 @@ only the most recent one can be undone.
...
@@ -1214,6 +1212,50 @@ only the most recent one can be undone.
\code
{
eq
}
.
\code
{
eq
}
.
\end{defun}
\end{defun}
\subsection
{
Tracing Examples
}
Here is an example of tracing with some of the possible options.
For simplicity, this is the function:
\begin{example}
(defun fact (n)
(declare (double-float n) (optimize speed))
(if (zerop n)
1d0
(* n (fact (1- n)))))
(compile 'fact)
\end{example}
This example shows how to use the :condition option:
\begin{example}
(trace fact :condition (= 4d0 (debug:arg 0)))
(fact 10d0) ->
0: (FACT 4.0d0)
0: FACT returned 24.0d0
3628800.0d0
\end{example}
As we can see, we produced output when the condition was satisfied.
Here's another example:
\begin{example}
(untrace)
(trace fact :break (= 4d0 (debug:arg 0)))
(fact 10d0) ->
0: (FACT 5.0d0)
1: (FACT 4.0d0)
Breaking before traced call to FACT:
[Condition of type SIMPLE-CONDITION]
Restarts:
0: [CONTINUE] Return from BREAK.
1: [ABORT ] Return to Top-Level.
Debug (type H for help)
\end{example}
In this example, we see that normal tracing occurs until we the
argument reaches 4d0, at which point, we break into the debugger.
% section{The Single Stepper}
% section{The Single Stepper}
%
%
% \begin{defmac}{}{step}{ \args{\var{form}}}
% \begin{defmac}{}{step}{ \args{\var{form}}}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment