我需要调试我的程序callfilter,当它在Visual Studio中像这样启动时代码:
zcat file.gz | build/callfilter/callfilter -M 10
这在vscode中可行吗?下面是它的当前启动配置,它可以在没有任何管道输入的情况下启动它:
"configurations": [
{
"name": "(gdb) callfilter",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/callfilter/callfilter",
"args": ["-M", "10"],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
1条答案
按热度按时间mqkwyuun1#
它的工作原理是填充
args
以从管道中读取:"args": ["<", "in.txt"]
更多信息,请访问:https://code.visualstudio.com/docs/editor/debugging#_redirect-inputoutput-tofrom-the-debug-target