idbg.bp: idbg.bp

Description Usage Arguments Value Author(s) See Also Examples

View source: R/idbg.R

Description

Prepare a function for debugging and set a breakpoint

Usage

1
idbg.bp(func_name, line_number = NA, condition = TRUE)

Arguments

func_name

name for function. Must be of type character

line_number

line number where to set the breakpoint

condition

a condition to evaluate for conditional breakpoint

Value

Logical. TRUE if the breakpoint was set, FALSE if it wasn't

Author(s)

Ronen Kimchi

See Also

debug undebug

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
bar <- function(a)
{
  if (a < 0)
    cat("a < 0\n")
  else
    cat("a >= 0\n")
  return(a)
}
foo <- function(x,y)
{
  tmp <- bar(x - y)
  return(tmp)
}  

## Not run: idbg.bp("foo")

# call foo to enter the debugger
# in the debugger type h to see the help
# use n or enter to step over
# use s to step into bar
## Not run: foo(2,3)

idbg documentation built on May 1, 2019, 7:32 p.m.