Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to quit debug/browser mode

In Rstudio console, I ran the following commands

> debug(ls)
> ls()

Then, I could not quit/leave the debug mode. I tried the following:

1, "Q" + "enter key" 2, "c" + "enter key" 3. the red "Stop" button.

but it does not leave debug mode.


Browse[2]> Q
debugging in: ls(.Internal(getNamespaceRegistry()), all.names = TRUE)
debug: {
    if (!missing(name)) {

Error: unable to quit when browser is active
Browse[2]> c
exiting from: ls(.Internal(getNamespaceRegistry()), all.names = TRUE)
debugging in: ls(.Internal(getNamespaceRegistry()), all.names = TRUE)
debug: {
    if (!missing(name)) {

.....


The Rstudio version: Version 0.98.1060 – © 2009-2013 RStudio, Inc.

The R version: R i386.3.1.1

Has anyone had this issue in Rstudio? Thanks. Ang

like image 585
angli Avatar asked Oct 21 '14 22:10

angli


People also ask

How do I get out of debug mode?

To exit debug mode, press Alt+B followed by D. at the Command Prompt to exit debug mode.

How do I exit debug mode in Chrome?

Go to the "Sources" tab. At the top right hand side, toggle the button that looks like the pause symbol surrounded by a hexagon (button on the far right) until the color of the circle turns black to turn it off. If the pause symbol isn't blue it may be that you've accidentally marked a line for debugging inspection.

How do I get out of browser mode in R?

Save this answer. Show activity on this post. The help page ? browser says that typing c and hitting enter will get you out of the browser and let the function continue to run or typing Q and hitting enter will exit the browser and the function and take you back to the top-level prompt.

What is browser debugging?

Debugging is the process of finding and fixing errors within a script. All modern browsers and most other environments support debugging tools – a special UI in developer tools that makes debugging much easier. It also allows to trace the code step by step to see what exactly is going on.


1 Answers

The problem is that as soon as you leave debug mode, something is triggering a call to ls, which puts you back in debug mode. To fix the issue, turn off debugging for ls before you leave the debugger:

Browse[2]> undebug(ls)
Browse[2]> Q

Consider using debugonce rather than debug to avoid getting into these kinds of loops.

like image 182
Jonathan Avatar answered Sep 22 '22 11:09

Jonathan