Skip to content

Commit

Permalink
Add debugging config for Visual Studio Code
Browse files Browse the repository at this point in the history
  • Loading branch information
dstolpmann committed Mar 15, 2022
1 parent 4ab31ab commit ddbb294
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
/* Source: https://www.vinnie.work/blog/2020-10-22-vscode-c-debug/#debugging-builds-with-containerized-debugger */
"name": "Debug FlowEmu in Docker environment",
"type": "cppdbg",
"preLaunchTask": "run_docker_debug",
"request": "launch",
"program": "/usr/bin/flowemu",
"cwd": ".",
"sourceFileMap": { "/flowemu": "${workspaceFolder}" },
"pipeTransport": {
"pipeProgram": "docker",
"pipeArgs": ["exec", "-i", "channel"],
"pipeCwd": "${workspaceFolder}",
"quoteArgs": false
},
"MIMode": "gdb",
"setupCommands": [
{
"description": "Connect to gdbserver",
"text": "target remote 127.0.0.1:1234",
"ignoreFailures": false
},
/* Source: https://stackoverflow.com/a/59431811 */
{
"description": "Load pretty-printer for libstdc++",
"text": "python import sys; sys.path.insert(0, '/usr/share/gcc/python'); from libstdcxx.v6.printers import register_libstdcxx_printers; register_libstdcxx_printers(None)",
"ignoreFailures": false
},
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": false
}
]
}
]
}
32 changes: 32 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "run_docker",
"type": "shell",
"command": "./run.py",
"args": ["config/environments/docker"]
},
{
"label": "run_docker_debug",
"type": "shell",
"command": "./run.py",
"args": ["config/environments/docker_debug"],
"isBackground": true,
/* Source: https://stackoverflow.com/questions/44242048/how-to-make-vscode-not-wait-for-finishing-a-prelaunchtask */
"problemMatcher": {
"owner": "custom",
"pattern": {
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
},
"background": {
"beginsPattern": ".",
"endsPattern": "Listening on port 1234"
}
}
}
]
}

0 comments on commit ddbb294

Please sign in to comment.