Skip to content

Instantly share code, notes, and snippets.

@jyapayne
Last active March 13, 2024 18:47
Show Gist options
  • Save jyapayne/34474bd7fdb4bca17495ddfaad111af2 to your computer and use it in GitHub Desktop.
Save jyapayne/34474bd7fdb4bca17495ddfaad111af2 to your computer and use it in GitHub Desktop.
Nim LLDB VSCode Debug Config

Needs this PR. Put these files in the .vscode folder in the root of your Nim project directory.

Also needs the CodeLLDB extention for VSCode.

Then you should see Debug Refc and Debug ORC in your debugging options.

{
"version": "0.2.0",
"configurations": [
{
"preLaunchTask": "Nim Build (Debug)",
"preRunCommands": [
"command script import --allow-reload ~/Nim/tools/debug/nimlldb.py"
],
"type": "lldb",
"request": "launch",
"name": "Debug ORC",
"program": "${workspaceFolder}/bin/${fileBasenameNoExtension}",
"args": [],
"cwd": "${workspaceFolder}"
},
{
"preLaunchTask": "Nim Build RefC (Debug)",
"preRunCommands": [
"command script import --allow-reload ~/Nim/tools/debug/nimlldb.py"
],
"type": "lldb",
"request": "launch",
"name": "Debug RefC",
"program": "${workspaceFolder}/bin/${fileBasenameNoExtension}",
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"label": "Nim Build (Debug)",
"command": "nim",
"args": [
"c",
"--mm:orc",
"-d:nimTypeNames",
"--deepcopy",
"--debugger:native",
"-o:${workspaceRoot}/bin/${fileBasenameNoExtension}",
"${relativeFile}"
],
"options": {
"cwd": "${workspaceRoot}"
},
"type": "shell",
},
{
"label": "Nim Build RefC (Debug)",
"command": "nim",
"args": [
"c",
"--mm:refc",
"-d:nimTypeNames",
"--deepcopy",
"--debugger:native",
"-o:${workspaceRoot}/bin/${fileBasenameNoExtension}",
"${relativeFile}"
],
"options": {
"cwd": "${workspaceRoot}"
},
"type": "shell",
}
]
}
@kraptor
Copy link

kraptor commented Mar 13, 2024

Is this still up to date? Also... it would be nice to include this config information in the vs-code extension installation documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment