I'm using VSCode
on Linux and I've came up with a the following launch configuration in my attempt to fire the VSCode
debugger, which, in turn, would rely on gdb
:
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": ["a", "b", "c", "d", "e"],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "make project"
}]
}
Here, using the args
attribute I'd like to pass 5 arguments to the process I'm debugging, namely: "a", "b", "c", "d", "e".
However, when I run the debugger, the argc
value is correctly set to 6, but the values themselves, stored by argv
are not present.