Skip to content

Commit

Permalink
Add support for debugging C++ from Positron
Browse files Browse the repository at this point in the history
See posit-dev/positron#4534
On Linux I also needed to run
sudo sysctl -w kernel.yama.ptrace_scope=0
  • Loading branch information
rstub committed Sep 6, 2024
1 parent a3eaab5 commit 003ab0c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
^\.cache$
^compile_commands\.json$
^touchstone$
^\.vscode$
^debug$
28 changes: 28 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch R",
"type": "lldb",
"request": "launch",
"program": "/Library/Frameworks/R.framework/Resources/bin/exec/R",
"args": [
"--vanilla",
"-e",
"source('debug/debug.R')"
],
"env": {
"R_HOME" : "/Library/Frameworks/R.framework/Resources"
},
"terminal": "console",
"stopOnEntry": false
},
{
"name": "(lldb) Attach to R",
"type": "lldb",
"request": "attach",
"pid": "${command:pickMyProcess}",
"stopOnEntry": false
}
]
}
7 changes: 7 additions & 0 deletions debug/debug.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
devtools::clean_dll()
devtools::load_all()
Sys.getpid()

dqrng::dqrunif(10)

dqrng::dqRNGkind("pcg64")

0 comments on commit 003ab0c

Please sign in to comment.