gdb debug with sudo privilege can't pause or set new breakpoint

未关闭
#9,659 6 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
vscode
领域
devtools

调研方向

使用提供的 launch.json 和 .vscode/gdb.sh 通过 Remote SSH 重现该问题,然后将行为与以 root 登录时进行比较。首先跟踪扩展如何与通过 sudo 启动的 GDB 进程通信,重点关注暂停和断点命令。完成的标准是确定原因,并且使用所述 sudo 配置的非 root 用户可以暂停和设置断点,或者将该限制记录下来。

由索引模型根据 Issue 内容生成。

描述

debugger more info needed

Issue Type: Bug

User logged in has sudo privilege, and been setted NOPASSWD in /etc/sudoers.
The snippet of launch.json is:

      "name": "gdb launch",
      "type": "cppdbg",
      "request": "launch",
      "program": "${workspaceFolder}/lib/app",
      "args": [],
      "stopAtEntry": true,
      "cwd": "${workspaceFolder}/lib",
      "environment": [],
      "externalConsole": false,
      "miDebuggerPath": "${workspaceFolder}/.vscode/gdb.sh",
      "MIMode": "gdb",

Where gdb.sh is :

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

When debugging through gdb in remote ssh mode, vscode can't pause or set new breakpoint.
But there is no problem while loginning as root.

Environment:
Linux username-VirtualBox 5.4.0-110-generic #124~18.04.1-Ubuntu SMP Fri Apr 22 12:01:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1
VSCode and all extensions are the up to date till this issue.

Extension version: 1.11.4
VS Code version: Code 1.69.2 (3b889b090b5ad5793f524b5d1d39fda662b96a2a, 2022-07-18T16:12:52.460Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No
Remote OS version: Linux x64 5.4.0-110-generic

主要语言
TypeScript
星标
6.2k
派生
1.7k
平均合并
14 小时 46 分钟
30 天内合并 PR
61

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/vscode-cpptools 的其他 Issue

查看 microsoft/vscode-cpptools 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。