Skip to content

Instantly share code, notes, and snippets.

@zjplab
Last active July 12, 2020 12:40
Show Gist options
  • Save zjplab/779491547d5ecb87adc22038218f6b22 to your computer and use it in GitHub Desktop.
Save zjplab/779491547d5ecb87adc22038218f6b22 to your computer and use it in GitHub Desktop.
VS Code C++ GDB Debugging Launch.son
{
// 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": [
{
"name": "(gdb) Bash on Windows Launch",
"type": "cppdbg",
"request": "launch",
"program": "./a.out",
"args": [],
"stopAtEntry": false,
"cwd": "/mnt/c/Users/zjplab/Desktop/EVA",
"environment": [],
"externalConsole": false,
"pipeTransport": {
"debuggerPath": "/usr/bin/gdb",
"pipeProgram": "${env:windir}\\system32\\bash.exe",
"pipeArgs": ["-c"],
"pipeCwd": ""
},
"sourceFileMap": {
"/mnt/c/Users/zjplab/Desktop/EVA":"C:/Users/zjplab/Desktop/EVA",
"/usr":"C:\\Users\\zjplab\\AppData\\Local\\Packages\\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\\LocalState\\rootfs\\usr"
},
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/lp_generator/lp_generator.exe",
"args": ["--budget", "99",
"--xml", "../example_output/smallKDG.xml",
"--app", "smallKDG"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/lp_generator",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\utils\\mingw\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
@zjplab
Copy link
Author

zjplab commented May 7, 2020

Note:

  1. VSCode does not convert windows "" to unix "/"

  2. The way to type input arguments

@zjplab
Copy link
Author

zjplab commented Jul 12, 2020

"sourceFileMap": {
                "/mnt/c/Users/zjplab/Desktop/EVA":"C:/Users/zjplab/Desktop/EVA",
                "/usr":"C:\\Users\\zjplab\\AppData\\Local\\Packages\\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\\LocalState\\rootfs\\usr"
             },

This is for read lib files located in WSL system

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