【问题标题】:Debugging in VS Code in Ubuntu在 Ubuntu 中使用 VS Code 进行调试
【发布时间】:2020-03-12 19:19:37
【问题描述】:

所以我在 Ubuntu 的 VS Code 中调试程序时遇到问题。当我尝试收到此消息时,launch:program '输入程序名称,例如 /home/daniel/Desktop/OOP/Test/a.out' 不存在,我可以选择查看 launch.json 文件。那么有什么想法有什么问题吗?还有什么问题?

这是 launch.json 文件:

{
    // 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) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "enter program name, for example ${workspaceFolder}/a.out",
            "args": [],
            "stopAt`enter code here`Entry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

【问题讨论】:

  • "program": "enter program name, for example ${workspaceFolder}/a.out" 不为自己说话吗?

标签: c++ ubuntu visual-studio-code


【解决方案1】:

换行试试

"program": "输入程序名称,例如${workspaceFolder}/a.out",

到这里

“程序”:“/home/daniel/Desktop/OOP/Test/a.out”,

【讨论】:

  • 是的,这有帮助。但是当我尝试调试并在某处添加断点时,调试器会停止。我的意思是我已经编写了一行代码并尝试了带有断点的调试器,但它停止了,我无法使用调试器逐行遍历代码。为什么?
猜你喜欢
  • 2019-05-30
  • 2019-06-26
  • 1970-01-01
  • 2022-11-24
  • 2022-01-11
  • 2021-07-12
  • 2017-02-11
  • 2017-08-09
  • 1970-01-01
相关资源
最近更新 更多