Skip to content
Prev 55134 / 63424 Next

debugonce() functions are not considered as debugged

Gabor,

Others can speak to the origins of this more directly, but from what I
recall this has been true at least since I was working in this space on the
debugcall stuff a couple years ago. I imagine the reasoning  is what you
would expect: a single bit of course can't tell R both that a function is
debugged AND that it should undebug after the first call.  I don't know of
any R-facing way to check for debugonce status, though its possible I
missed it

That said, it would be possible to alter how the two bits are used so that
debugonce sets both of them, and debug (not once) only sets one, rather
them being treated as mutually exclusive. This would alter the behavior so
that debugonce'ed functions that haven't been called yet are considered
debugged, e.g., by isdebugged.

This would not, strictly speaking, be backwards compatible, but by the very
nature of what debugging means, it would not break any existing script
code. It could, and likely would, effect code implementing GUIs, however.

R-core - is this a patch that you are interested in and would consider
incorporating? If so I can volunteer to work on it.

Best,
~G

On Sat, Apr 28, 2018 at 4:57 AM, G?bor Cs?rdi <csardi.gabor at gmail.com>
wrote:

  
    
Message-ID: <CAMFmJs=BHa9_f3bB-rsuVq-KOEQ4H9g=70q1H6pdPMOZ9PxvaQ@mail.gmail.com>
In-Reply-To: <CABtg=K=Q2k8Qr7uk=XQ2Qa76NWUcG0PmDMseZ37E2RZm4=XqDQ@mail.gmail.com>