microsoft / microsoft/vscode-cpptools

RedHat/CentOS el7.x86_64 - GDB: Failed to set controlling terminal; Creates a file with name "2"

Open
#2,787 8 comments 0 reactions 1 assignee View on GitHub

@pieandcakes is already working on this.

Since Nov 7, 2018.

debugger
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Originally posted by @FranzDeCopenhague in https://github.com/Microsoft/vscode-cpptools/issues/264#issuecomment-352234542

I am also seeing this in CentOS 7.

My launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build/bin/syshealth",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}/build/bin",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "build"
        }
    ]
}

My c_cpp_properties.json:

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE"
            ],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++11",
            "intelliSenseMode": "clang-x64",
            "compileCommands": "${workspaceRoot}/build/compile_commands.json"
        }
    ],
    "version": 4
}

When I try to launch the debugger, I get a terminal window that appears that says: &"warning: GDB: Failed to set controlling terminal: Operation not permitted\n".

The VSCode debugger is inoperable:

  • Clicking on the pause button produces no results (only restart and stop do)
  • the debug console prints Unable to perform this action because the process is running. no matter what GDB command I send.
  • no variables or symbols appear in the debug pane.

Another interesting symptom is that a file with the name "2" appears in my build/bin directory with the contents -e c 1. This file only appears after I attempt to launch a debugging session.

Running GDB standalone from a separate terminal session doesn't seem to have any problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.