undebug all functions

前端 未结 3 1838
暗喜
暗喜 2021-02-03 22:27

Consider we have called debug() for several functions to make a breakpoint on them. When we find and solve the bug, is there anyway to undebug() all fu

3条回答
  •  悲&欢浪女
    2021-02-03 23:12

    No, there is no completely reliable way to undebug() all functions. (I only say this because I've seen it discussed several times on R-devel and R-help.)

    In this discussion, Brian Ripley weighed in, noting that:

    Debugging is a property of a function object (a bit in the sxpinfo) and so you would have to traverse all reachable objects (as gc does) to find them all.

    Here's a snippet in which Robert Gentleman answers (in the negative) a question about whether "there is a convenient way to know at any time which are the function flagged with debug() or trace() in a R session":

    You probably didn't get an answer because the answer is no, there is no easy way.

提交回复
热议问题