microsoft / microsoft/vscode-cpptools

Unable to debug program that requires root permission in Linux VSCODE

Open
#5,586 3 comments 0 reactions 1 assignee View on GitHub

@WardenGnaw is already working on this.

Since May 31, 2020.

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

Description

Type: Debugger

I have seen previous workaround of using bash script to wrap gdb script. I have done that. But still I hit the following error showing in VScode Linux terminal

[1] + Stopped (tty output) "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-a950fu1m.9l8" 1>"/tmp/Microsoft-MIEngine-Out-gzjlvx7g.xil"
You have stopped jobs.
[sudo] password for kenneth:
sudo: unable to read password: Input/output error

My launch.json is as following

"version": "0.2.0",
"configurations": [
    {
        "name": "(gdb) Launch",
        "type": "cppdbg",
        "request": "launch",
        "program": "/home/kenneth/GitHub/rocksdb/examples/simple_example",
        "args": [],
        "stopAtEntry": true,
        "cwd": "${workspaceFolder}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "miDebuggerPath": "/usr/bin/gdb",
        "miDebuggerArgs": "-interpreter=mi --silent",
        "setupCommands": [
            {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            }
        ]
    }
]

}

Describe the bug

  • OS and Version:Ubuntu
  • VS Code Version: 1.45.0
  • C/C++ Extension Version: 0.28.1
  • Other extensions you installed (and if the issue persists after disabling them):
  • A clear and concise description of what the bug is.

To Reproduce
Please include a code sample and launch.json configuration.
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Additional context
If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your launch.json
Add any other context about the problem here including log or error messages in your Debug Console or Output windows.

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.