将参数传递给C++;VSCode中的调试程序 < >我想在VSCode中调试一个C++项目(在MAC上,使用GDB或LLDB)。程序本身接受命令行参数,如 ./prog -input cf file_x.txt
当在命令行上启动GDB中的调试会话时,这可以正常工作 在VSCode中,我尝试将将参数传递给C++;VSCode中的调试程序 < >我想在VSCode中调试一个C++项目(在MAC上,使用GDB或LLDB)。程序本身接受命令行参数,如 ./prog -input cf file_x.txt,c++,visual-studio-code,cmdline-args,C++,Visual Studio Code,Cmdline Args,当在命令行上启动GDB中的调试会话时,这可以正常工作 在VSCode中,我尝试将launch.json改编为如下内容(仅显示相关行): 这样,我在输出中得到@“Unknown option:\”-input cf\“\r\n”,并且进程没有调试;或者,我只试过这样一个论点: "program": "${workspaceRoot}/build/prog", "args": [ "-input cf path_to/file_x.txt"
launch.json
改编为如下内容(仅显示相关行):
这样,我在输出中得到@“Unknown option:\”-input cf\“\r\n”
,并且进程没有调试;或者,我只试过这样一个论点:
"program": "${workspaceRoot}/build/prog",
"args": [
"-input cf path_to/file_x.txt"
]
产生相同的消息。我错过了什么重要的事情吗?像这样试试看
"program": "${workspaceRoot}/build/prog",
"args": [
"-input",
"cf",
"path_to/file_x.txt"
]
"program": "${workspaceRoot}/build/prog",
"args": [
"-input",
"cf",
"path_to/file_x.txt"
]