[Rd] debugonce() functions are not considered as debugged

Tomas Kalibera tom@@@k@liber@ @ending from gm@il@com
Mon May 21 18:01:55 CEST 2018

debug(fun) marks "fun" for debugging, it makes sure that whenever "fun" 
is called, the debugger is entered
undebug(fun) removes this mark; it won't stop any current debugging of 
that function
isdebugged(fun) tells whether this mark is set or not; it does not tell 
whether "fun" is currently running in a debugger/browser

debugonce(func) adds a different mark to the function, one that makes 
sure the first time "fun" is called, the debugger is entered; this is 
the same as when entering that function via "s" while debugging its 
caller. There is no way to query or unset this mark.

Do you have a good use case when it would be useful to query/unset the 
mark for debugonce?


On 04/28/2018 01:57 PM, Gábor Csárdi wrote:
> debugonce() sets a different flag (RSTEP), and this is not queried by
> isdebugged(), and it is also not unset by undebug().
> Is this expected? If yes, is there a way to query and unset the RSTEP flag
> from R code?
> ❯ f <- function() { }
> ❯ debugonce(f)
> ❯ isdebugged(f)
> [1] FALSE
> ❯ undebug(f)
> Warning message:
> In undebug(f) : argument is not being debugged
> ❯ f()
> debugging in: f()
> debug at #1: {
> }
> Browse[2]>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

More information about the R-devel mailing list