Skip to content

Can't break in the attach mode #193

@kubajal

Description

@kubajal

NOTE: Before submitting an issue, please make sure to install the latest version of both the vscode extension and the R package. This can usually be achieved by running the command r.debugger.updateRPackage in vscode's command palette (F1).

Describe the bug
Can't make VSCode stop at breakpoints upon attaching to the R process as documented in https://github.com/ManuelHentschel/vscDebugger/blob/master/vignettes/vscode-R-Debugger.Rmd#L65.

To Reproduce
Steps to reproduce the behavior:

  1. Execute the following R code:
library(vscDebugger)
print('Started listening for debugging connections...')
.vsc.listen()
print('Got a debugging connection...')
Sys.sleep(5)
.vsc.debugSource('file.R')
print('Finished executingR')
  1. When the R script execution reaches .vsc.debugSource('file.R') start the R debugger with the following configuration:
        {
            "type": "R-Debugger",
            "name": "Attach to R process",
            "request": "attach",
            "useCustomSocket": true
        },
  1. In VSCode, set manually some debugging points in file.R
  2. Hit the 'Continue' button so the debugger proceeds stepping through the code
  3. The debugger doesn't stop at any breakpoints defined in step 3.

Your R code

library(vscDebugger)
print('Started listening for debugging connections...')
.vsc.listen()
print('Got a debugging connection...')
Sys.sleep(5)
.vsc.debugSource('file.R')
print('Finished executingR')

Your Launch config

        {
            "type": "R-Debugger",
            "name": "Attach to R process",
            "request": "attach",
            "useCustomSocket": true
        },

Expected behavior
The debugger should stop at any breakpoint defined in file.R in VSCode.

Actual behavior
The debugger just executes the file without stopping at any breakpoints.

Desktop (please complete the following information):

  • OS: Ubuntu 22
  • R Version: 4.1.2
  • vscDebugger Version: 0.5.5
  • vscode-r-debugger Version: 0.5.3

Additional context
Not sure if I need to use Sys.sleep(5)? Perhaps that line could be removed. Also do I need to use "useCustomSocket": true?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions