无法开始调试。没有终端可用于启动调试器。请安装Gnome Terminal或XTerm

时间:2016-07-13 20:06:22

标签: linux debugging gdb visual-studio-code

我正在尝试使用visual studio代码调试简单的hello世界。如何在我的调试器设置文件中设置终端路径?我正在使用以下设置。

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "C++ Launch (GDB)",
            "type": "cppdbg",
            "request": "launch",
            "launchOptionType": "Local",
            "miDebuggerPath": "/usr/bin/gdb",
            "targetArchitecture": "x64",
            "program": "${workspaceRoot}/hello.out",
            "args": [],
            "stopAtEntry": true,
            "cwd": "${workspaceRoot}",
            "environment": [],
            "externalConsole": true
        },
        {
            "name": "C++ Attach (GDB)",
            "type": "cppdbg",
            "request": "launch",
            "launchOptionType": "Local",
            "miDebuggerPath": "/usr/bin/gdb",
            "targetArchitecture": "x64",
            "program": "${workspaceRoot}/hello.out",
            "args": [],
            "stopAtEntry": true,
            "cwd": "${workspaceRoot}",
            "environment": [],
            "processId": "enter program's process ID",
            "externalConsole": true
        }
    ]
}

2 个答案:

答案 0 :(得分:1)

修复很简单,打开终端并输入以下命令:

cd /usr/bin
sudo ln -s ./{your_terminal} xterm

答案 1 :(得分:0)

创建这个/ usr / bin / xterm脚本:

#!/bin/bash
/usr/bin/konsole -e 'bash -c "$6"'

在VSCode中正常工作。由于引用,符号链接无法正常工作。