-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add debugging config for Visual Studio Code
- Loading branch information
1 parent
4ab31ab
commit ddbb294
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} | ||
] | ||
} |