From tom@@@k@liber@ @ending from gm@il@com  Mon May 21 18:01:55 2018
From: tom@@@k@liber@ @ending from gm@il@com (Tomas Kalibera)
Date: Mon, 21 May 2018 18:01:55 +0200
Subject: [Rd] debugonce() functions are not considered as debugged
In-Reply-To: <CABtg=K=Q2k8Qr7uk=XQ2Qa76NWUcG0PmDMseZ37E2RZm4=XqDQ@mail.gmail.com>
References: <CABtg=K=Q2k8Qr7uk=XQ2Qa76NWUcG0PmDMseZ37E2RZm4=XqDQ@mail.gmail.com>
Message-ID: <63f24fd9-a224-7997-fb3a-ef8f87a24306@gmail.com>

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?

Best,
Tomas

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



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