禁用RStudio中的所有断点

时间:2015-10-05 22:54:18

标签: rstudio

有没有办法禁用RStudio中的所有断点?我查看了RStudio文档以及谷歌搜索,但无法找到方法。

2 个答案:

答案 0 :(得分:2)

我也很好奇,尤其想了解断点。

我在项目文件夹中运行了grep,这是我发现的:

首先,打开RStudio时,断点不会显示,它们可能位于内存中的某个位置:

$ grep -inIEr "breakpoint" .
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:2:    "debugBreakpointsState" : {
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:3:        "breakpoints" : [
grep: ./.Rproj.user/1C48145B/sources/s-8EAA4F36/lock_file: Device or resource busy

然后,当我们关闭RStudio时,似乎它们已写入名为debug-breakpoints.pper的文件中。

$ grep -inIEr "breakpoint" .
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:2:    "debugBreakpointsState" : {
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:3:        "breakpoints" : [
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:10:                "is_package_breakpoint" : false,
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:25:                "is_package_breakpoint" : false,
./.Rproj.user/1C48145B/pcs/find-in-files.pper:7:        "query" : "breakpoint",

该文件位于./.Rproj.user/1C4***5B/pcs/debug-breakpoints.pper上,如下所示:

{
    "debugBreakpointsState" : {
        "breakpoints" : [
            {
                "editor_line_number" : 4,
                "editor_state" : 1,
                "function_name" : "toplevel",
                "function_steps" : "",
                "id" : 2,
                "is_package_breakpoint" : false,
                "is_pending_debug_completion" : false,
                "line_number" : 4,
                "needs_updated_steps" : false,
                "package_name" : "",
                "path" : "C:/Users/path/to/project/analysis_tab.R",
                "state" : 1,
                "type" : 1
            },
            {
                "editor_line_number" : 193,
                "editor_state" : 1,
                "function_name" : "toplevel",
                "function_steps" : "",
                "id" : 3,
                "is_package_breakpoint" : false,
                "is_pending_debug_completion" : false,
                "line_number" : 193,
                "needs_updated_steps" : false,
                "package_name" : "",
                "path" : "C:/Users/path/to/project/analysis_tab.R",
                "state" : 1,
                "type" : 1
            }
        ]
    }
}

在RStudio关闭时手动编辑此文件,使我们可以管理断点。 (在打开RStudio的情况下,对该文件所做的更改最终将被覆盖)。

答案 1 :(得分:0)

就在“调试”菜单下: enter image description here

默认键盘快捷键(在我的系统上):Ctrl + Shift + F9