| 54739 |
ripley |
1 |
% File src/library/base/man/browserText.Rd
|
|
|
2 |
% Part of the R package, http://www.R-project.org
|
| 59039 |
ripley |
3 |
% Copyright 1995-2011 R Core Team
|
| 54739 |
ripley |
4 |
% Distributed under GPL 2 or later
|
|
|
5 |
|
| 48437 |
rgentlem |
6 |
\name{browserText}
|
| 56186 |
murdoch |
7 |
\alias{browserText}
|
| 48437 |
rgentlem |
8 |
\alias{browserCondition}
|
| 48551 |
rgentlem |
9 |
\alias{browserSetDebug}
|
| 48437 |
rgentlem |
10 |
\title{
|
| 50821 |
ripley |
11 |
Functions to Retrieve Values Supplied by Calls to the Browser
|
| 48437 |
rgentlem |
12 |
}
|
|
|
13 |
\description{
|
|
|
14 |
A call to browser can provide context by supplying either a text
|
|
|
15 |
argument or a condition argument. These functions can be used to
|
|
|
16 |
retrieve either of these arguments.
|
|
|
17 |
}
|
|
|
18 |
\usage{
|
| 61150 |
ripley |
19 |
browserText(n = 1)
|
|
|
20 |
browserCondition(n = 1)
|
|
|
21 |
browserSetDebug(n = 1)
|
| 48437 |
rgentlem |
22 |
}
|
| 48551 |
rgentlem |
23 |
\arguments{
|
|
|
24 |
\item{n}{The number of contexts to skip over, it must be non-negative.}
|
|
|
25 |
}
|
| 48437 |
rgentlem |
26 |
\details{
|
| 48551 |
rgentlem |
27 |
Each call to \code{browser} can supply either a text string or a condition.
|
|
|
28 |
The functions \code{browserText} and \code{browserCondition} provide ways
|
| 55555 |
ripley |
29 |
to retrieve those values. Since there can be multiple browser contexts
|
| 48551 |
rgentlem |
30 |
active at any time we also support retrieving values from the different
|
| 61433 |
ripley |
31 |
contexts. The innermost (most recently initiated) browser context is
|
| 55555 |
ripley |
32 |
numbered 1: other contexts are numbered sequentially.
|
| 48551 |
rgentlem |
33 |
|
|
|
34 |
\code{browserSetDebug} provides a mechanism for initiating the browser in
|
|
|
35 |
one of the calling functions. See \code{\link{sys.frame}} for a more
|
| 61433 |
ripley |
36 |
complete discussion of the calling stack. To use \code{browserSetDebug}
|
| 48551 |
rgentlem |
37 |
you select some calling function, determine how far back it is in the call
|
| 61433 |
ripley |
38 |
stack and call \code{browserSetDebug} with \code{n} set to that value.
|
| 48551 |
rgentlem |
39 |
Then, by typing \code{c} at the browser prompt you will cause evaluation
|
|
|
40 |
to continue, and provided there are no intervening calls to browser or
|
|
|
41 |
other interrupts, control will halt again once evaluation has returned to
|
|
|
42 |
the closure specified. This is similar to the up functionality in gdb
|
|
|
43 |
or the "step out" functionality in other debuggers.
|
| 48437 |
rgentlem |
44 |
}
|
|
|
45 |
\value{
|
|
|
46 |
\code{browserText} returns the text, while \code{browserCondition}
|
| 48551 |
rgentlem |
47 |
returns the condition from the specified browser context.
|
|
|
48 |
|
|
|
49 |
\code{browserSetDebug} returns NULL, invisibly.
|
| 48437 |
rgentlem |
50 |
}
|
|
|
51 |
\author{
|
|
|
52 |
R. Gentleman
|
|
|
53 |
}
|
|
|
54 |
\note{
|
|
|
55 |
It may be of interest to allow for querying further up the set of browser
|
|
|
56 |
contexts and this functionality may be added at a later date.
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
\seealso{
|
|
|
60 |
\code{\link{browser}}
|
|
|
61 |
}
|
|
|
62 |
\keyword{debugging}
|