microsoft / microsoft/vscode-cpptools

"warning gdb failed to set controlling terminal operation not permitted" when launching a GUI application.

オープン
#121 コメント 42 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

説明

Forked from #115

I am using:
•Ubuntu 16.04 (I know it is not supported officially)
•Latest VSCode version
•Latest "C/C++ for VSCode" version

My project structure looks like this:
•/home/lvier/mainProject/fooProject (source code)
•/home/lvier/mainProject/build/fooProject (binaries)

I am working in the sub-project "/home/lvier/mainProject/fooProject" and in "/home/lvier/mainProject/build/fooProject" there are many sub programs (lets say "foo", "foo_sub1", "foo_sub2" ...).

My goal:
I want to start the program "foo" (which starts all other foo_sub-programs) and then, I want to debug a certain sub program (let's say "foo_sub1") by attaching to it. I am also fine with starting and debugging in the same time as long as I can debug the sub-program "foo_sub1". The main project itself does not contain any executables.

2.Assume that "foo" is not running yet.
When using the "C++ Launch"-config, the program starts but no UI elements appear. Instead, it starts with a new terminal popping up which says "warning gdb failed to set controlling terminal operation not permitted" for a brief moment and in the internal console of VSCode, it states that it stops at a certain line of code (a breakpoint not defined by me) and prints
"Stopped due to shared library event (no libraries added or removed)
Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1"."
From there I can't continue further and I have to manually terminate the program.

When I use GDB without VSCode, i.e. just by native terminal, my program is starting properly but with VSCode, there seem to be some issues currently.

This is my current, autogenerated config where I only edited the "cwd" and "program" paths (assume that the environment variable "${env.build_foo}" is set to "/home/lvier/mainProject/build/fooProject"):

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "C++ Launch",
            "type": "cppdbg",
            "request": "launch",
            "targetArchitecture": "x64",
            "program": "${env.build_foo}/foo",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceRoot}",
            "environment": [],
            "externalConsole": true,
            "linux": {
                "MIMode": "gdb"
            },
            "osx": {
                "MIMode": "lldb"
            },
            "windows": {
                "MIMode": "gdb"
            }
        },
        {
            "name": "C++ Attach",
            "type": "cppdbg",
            "targetArchitecture": "x64",
            "request": "launch", // <-- "attach" is not allowed (anymore)! :(   
            "program": "${env.build_foo}/foo_sub1",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceRoot}",
            "environment": [],
            "processId": "${command.pickProcess}",
            "externalConsole": false,
            "linux": {
                "MIMode": "gdb"
            },
            "osx": {
                "MIMode": "lldb"
            },
            "windows": {
                "MIMode": "gdb"
            }
        }
    ]
}

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

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

はじめの一歩

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

調査の方向性

投稿された C++ Launch 構成と C++ Attach 構成から始め、特に externalConsole、cwd、program、${command.pickProcess} を確認します。同じプログラムをネイティブ GDB で実行した場合の動作と比較します。制御端末の警告と共有ライブラリでの停止を再現し、その後 GUI の起動が継続し、手動で終了せずに foo_sub1 プロセスにアタッチできることを確認します。

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

評価

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

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

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