quitting browser call with a twist
Imagine you're debugging a function within a function. You would be on level 2 (Browser [2]
). Is there a way to quit level 2 and go to level 1? Q
will drop you out of any debugging, so I'm looking for something that would just quit the current le开发者_运维问答vel.
If you can change to the level 2 function body, then get it to throw an error. Then set the error option to recover
. Now you can move between functions as you please.
foo <- function() bar()
bar <- function() stop("start debug here")
options(error = recover)
foo()
Is c
what you are looking for? It will continue execution of the current level and return you to level 1. Presumably you want whatever was running at level 2 to finish so level 1 is in a consistent state?
精彩评论