Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Opening this PR just to document the changes on this test branch, which demo a prototype LLDB setup.
You can try it out by building and running locally as described in the docs for local setup, but switching to the test/lldb branch before launching vscode.
Then:
allow_ptrace.cSys.getenv("LD_PRELOAD")should show `"/workspaces/r-dev-env/scripts/allow_ptrace.so"). Quit R.CFLAGS="-g -O0"before the configure step).launch.shscript:Sys.getenv("LD_PRELOAD").Sys.getpid()to get the process ID of R.rgamma(5,1)and the debugger will start.Tested on Ubuntu 24.04 with fresh checkout from devel branch:
Note that debugger will not work for the pre-built version of R, as it was installed from a binary and we don't have access to the source files!
To get this working nicely we would want to do steps 1 and 2 as part of the devcontainer setup. Step 4 should be done by the which_r script - not by simply editing comments, but dynamically switching the path to the R executable, in a similar way to how we currently switch the path in the vscode settings:
r-dev-env/scripts/which_r.sh
Lines 63 to 64 in 46b8b6c
After running the debugger we get a new button in the status bar labelled "(lldb) Attach to R (r-dev-env)" that you can use to select and start the debug configuration. This is okay, but it hides the "R: (not attached)" button. So either people need to hide some more things in the Status bar, or open R via the command palette. We would probably need to say something about this in the docs.