microsoft / microsoft/vscode-cpptools

Unable to pause execution with root gdb

Open
#4,243 46 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Type: Debugger

Describe the bug

  • OS and Version: Ubuntu 16.04.6 LTS
  • VS Code Version: 1.38.1
  • C/C++ Extension Version: 0.25.1

We needed to debug a program which needs root privileges to be run. In order to do this a added a wrapper to gdb to lauch with sudo and without password.

#!/bin/bash
sudo gdb "$@"

When we launch a program with the wrapped dbg(set on miDebuggerPath), we are not able to pause the execution of the program or add and stop on a breakpoint.

Although, when the breakpoint is already set before lauching the debugger, it will pause there and we are able to step through the code and also set new breakpoints. After removing the breakpoints and continuing execution we are again unable to pause execution.

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.

Research direction

Start by reproducing the failure with the sudo gdb wrapper configured through miDebuggerPath on Ubuntu. Compare pausing and breakpoint behavior before and after continuing execution; done means execution can be paused and breakpoints can be added reliably while debugging a root-required program.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, typescript, ubuntu, vscode
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.