首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >GDB未能设置附件visual studio docker上不允许的控制终端操作。

GDB未能设置附件visual studio docker上不允许的控制终端操作。
EN

Stack Overflow用户
提问于 2021-04-27 15:03:31
回答 1查看 3.6K关注 0票数 2

我正在尝试使用GDB调试器运行我的程序。当我运行它时,我会收到一个警告:

代码语言:javascript
运行
复制
GDB: Failed to set controlling terminal: Operation not permitted

这个警告在我的终端上很快就消失了。我已经检查了一些stackoverflow questions,但是由于我正在运行连接到我的(远程容器)的visual,所以我无法应用一些建议。

当我在代码中尝试刹车点时,GDB不工作,程序执行时忽略GDB。

我的lauch.json配置:

代码语言:javascript
运行
复制
{
    // 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": "${workspaceFolder}/words",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }

    ]
}

我正在运行程序的dockerfile配置:

代码语言:javascript
运行
复制
FROM ubuntu:18.04

SHELL ["/bin/bash", "-c"]

RUN apt-get -y update
RUN apt-get install -y Linux-headers-generic build-essential gdb

COPY . /ejercicio
EN

回答 1

Stack Overflow用户

发布于 2021-09-30 07:44:20

检查您的代码实际上是用调试构建的。根据经验(在Linux中),如果您没有任何符号,GDB会在VS代码会话期间导致此错误。即向所有编译和链接语句中添加-g命令行选项。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67285656

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档