microsoft / microsoft/vscode-cpptools

Sudo elevation not working with gdb

オープン
#4,196 コメント 5 件 リアクション 11 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

debugger Feature Request
主要言語
TypeScript
スター
6.2k
フォーク
1.7k
平均マージ
14時間 46分
マージ済み PR(30日)
61

説明

Type: Debugger

Describe the bug

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

When trying to attach with gdb it correctly asks "Superuser access is required to attach to a process. Attaching as superuser can potentially harm your computer. Do you want to continue? [y/N]". After typing "y" and enter, I get the following:

==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/bin/gdb' as the super user
Multiple identities can be used for authentication:
 1.  ...
 2.  ...
 ...
Choose identity to authenticate as (1-16): [1] + Stopped (tty input)        /usr/bin/pkexec "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-hrnsnxv9.sdc" 1>"/tmp/Microsoft-MIEngine-Out-prn74k9m.v7c"
You have stopped jobs.

It immediately stops and doesn't let me select an identity. It says "Running" in the debug view but this seems not correct, also nothing happens when pressing pause.

To Reproduce
Please include a code sample and launch.json configuration.

        {
            "name": "Attach",
            "type": "cppdbg",
            "request": "attach",
            "MIMode": "gdb",
            "program": "...",
            "processId": "${command:pickProcess}",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        },

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

提供された launch.json 構成を使用し、GDB とプロセスピッカーで Ubuntu 18.04 上の attach フローを再現します。まず、レポートに示されている認証と pkexec のやり取りを調べます。アイデンティティを選択して attach が完了し、デバッグビューが正常に応答すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
vscode
領域
devtools, operating-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。