Skip to content

Commit b69b656

Browse files
author
smeyer
committed
typos/comments in R-exts#Debugging
git-svn-id: https://svn.r-project.org/R/trunk@88458 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 693f48b commit b69b656

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

doc/manual/R-exts.texi

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9361,6 +9361,7 @@ suite.
93619361
> glm(resp ~ 0+predictor, family = binomial(link="log"))
93629362
Error: no valid set of coefficients has been found: please supply starting values
93639363
> traceback()
9364+
@c FIXME: the call stack here and below is actually much longer since r50688
93649365
3: stop("no valid set of coefficients has been found: please supply
93659366
starting values", call. = FALSE)
93669367
2: glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart,
@@ -9434,7 +9435,8 @@ which does not help much, as there is no call to @code{as.environment}
94349435
in @code{initialize} (and the note ``called from internal dispatch''
94359436
tells us so). In this case we searched the @R{} sources for the quoted
94369437
call, which occurred in only one place,
9437-
@code{methods:::.asEnvironmentPackage}. So now we knew where the
9438+
@c @code{methods:::.asEnvironmentPackage} @c long removed (c76155)
9439+
so now we knew where the
94389440
error was occurring. (This was an unusually opaque example.)
94399441

94409442
The error message
@@ -9455,13 +9457,13 @@ options(expressions=500)
94559457
@noindent
94569458
and re-run the example showing the error.
94579459

9458-
Sometimes there is warning that clearly is the precursor to some later
9460+
Sometimes there is a warning that clearly is the precursor to some later
94599461
error, but it is not obvious where it is coming from. Setting
94609462
@command{options(warn = 2)} (which turns warnings into errors) can help here.
94619463

94629464
Once we have located the error, we have some choices. One way to proceed
94639465
is to find out more about what was happening at the time of the crash by
9464-
looking a @emph{@I{post-mortem}} dump. To do so, set
9466+
looking at a @emph{@I{post-mortem}} dump. To do so, set
94659467
@findex dump.frames
94669468
@command{options(error=dump.frames)} and run the code again. Then invoke
94679469
@command{debugger()} and explore the dump. Continuing our example:
@@ -9486,7 +9488,8 @@ Available environments had calls:
94869488
1: glm(resp ~ 0 + predictor, family = binomial(link = "log"))
94879489
2: glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart, mus
94889490
3: stop("no valid set of coefficients has been found: please supply starting values
9489-
Enter an environment number, or 0 to exit Selection:
9491+
Enter an environment number, or 0 to exit
9492+
Selection:
94909493
@end smallexample
94919494

94929495
@noindent
@@ -9499,7 +9502,7 @@ error message, and explore some of the variables (and execute two
94999502
function calls).
95009503

95019504
@smallexample
9502-
Enter an environment number, or 0 to exit Selection: 2
9505+
Selection: 2
95039506
Browsing in the environment with call:
95049507
glm.fit(x = X, y = Y, weights = weights, start = start, etas
95059508
Called from: debugger.look(ind)
@@ -9532,7 +9535,8 @@ Available environments had calls:
95329535
2: glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart
95339536
3: stop("no valid set of coefficients has been found: please supply starting v
95349537

9535-
Enter an environment number, or 0 to exit Selection: 0
9538+
Enter an environment number, or 0 to exit
9539+
Selection: 0
95369540
> rm(last.dump)
95379541
@end smallexample
95389542

@@ -9570,7 +9574,7 @@ Selection:
95709574
which is very similar to @code{dump.frames}. However, we can examine
95719575
the state of the program directly, without dumping and re-loading the
95729576
dump. As its help page says, @code{recover} can be routinely used as
9573-
the error action in place of @code{dump.calls} and @code{dump.frames},
9577+
the error action in place of @code{dump.frames},
95749578
since it behaves like @code{dump.frames} in non-interactive use.
95759579

95769580

@@ -9591,7 +9595,7 @@ debugging in: glm.fit(x = X, y = Y, weights = weights, start = start, etastart =
95919595
debug: @{
95929596
## lists the whole function
95939597
Browse[1]>
9594-
debug: x <- as.matrix(x)
9598+
debug: control <- do.call("glm.control", control)
95959599
...
95969600
Browse[1]> start
95979601
[1] -2.235357e-06
@@ -9619,7 +9623,7 @@ being debugged or contains a call to @code{browser()}.)
96199623
e.g.@: @code{debug(stats:::predict.Arima)}. (It cannot be used for S4
96209624
methods, but an alternative is given on the help page for @code{debug}.)
96219625
Sometimes you want to debug a function defined inside another function,
9622-
e.g.@: the function @code{arimafn} defined inside @code{arima}. To do so,
9626+
e.g.@: the function @code{armafn} defined inside @code{arima}. To do so,
96239627
set @code{debug} on the outer function (here @code{arima}) and
96249628
step through it until the inner function has been defined. Then
96259629
call @code{debug} on the inner function (and use @code{c} to get out of

0 commit comments

Comments
 (0)