【发布时间】:2018-02-06 11:16:12
【问题描述】:
我是 Visual Code 的新手。我想将调试功能与可视代码一起使用。 但是有一个问题可以做到。错误的launch.json设置可能会发生(在我的选择中)
我正在使用 mac os 最新版本。
我自己参考了一些页面。
https://code.visualstudio.com/docs/languages/cpp
https://github.com/Microsoft/vscode-cpptools/blob/master/launch.md
https://code.visualstudio.com/docs/python/debugging
但是我看到了同样的错误。它说“启动:程序 '${/Users/bpk/Documents/Study/C/Study}/study' 不存在”
这是我下面的 launch.json 文件
{
"version": "0.2.0",
"configurations": [
{
"name": "Python3",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"program": "${/Users/bpk/Documents/Study/Python3/study.py}",
"cwd": "${/Users/bpk/Documents/Study/Python3}",
"env": {},
"envFile": "${/Users/bpk/Documents/Study/Python3}/.env",
"debugOptions": [
"RedirectOutput"
]
},
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${/Users/bpk/Documents/Study/C/Study}/study",
"args": [],
"stopAtEntry": false,
"cwd": "${/Users/bpk/Documents/Study/C/Study}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "(gdb) Attach",
"type": "cppdbg",
"request": "attach",
"program": "${/Users/bpk/Documents/Study/C/Study}/study",
"processId": "${command:pickProcess}",
"MIMode": "gdb"
}
],
"compounds": []
}
=cmd-param-changed,param="pagination",value="off"
[New Thread 0x1803 of process 16326]
[New Thread 0x1a03 of process 16326]
[New Thread 0x2703 of process 16326]
ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". Warning:
Cannot insert breakpoint -1.
Cannot access memory at address 0xf782
The program '/Users/jaekwangkim/Documents/Workspace/Project/C/PE_File_Assembler/a.out' has exited with code 42 (0x0000002a).
上面的消息是来自可视代码的调试控制台日志
感谢阅读我的第一个问题!
【问题讨论】:
标签: python c++ debugging gdb visual-studio-code