Failed to open /dev/tty with vscode debugger
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- cpp, linux, vscode
調査の方向性
まず、添付された launch.json と debuglog.txt をコマンドラインからの gdb の呼び出しと比較し、次に VS Code C++ デバッガーがどのようにプログラムを起動し、その制御端末を提供するかを調べます。指定された Ubuntu 16.04 環境でサンプルの /dev/tty プログラムを使って問題を再現します。VS Code のデバッグ実行で、コマンドラインからの実行と同じように /dev/tty が開かれれば完了です。
索引モデルが issue の本文から書いたものです。
説明
In my program, I tried to read /dev/tty. The program cannot open the file with vscode debugger, but the file is successfully opened with gdb command line.
The source code is:
#include <stdio.h>
#include <fcntl.h>
int main(int argc, char const *argv[])
{
int f = open("/dev/tty", O_RDONLY);
printf("open tty %d\n",f);
return 0;
}
The program is then build with g++ -g ./main.cpp.
When I use gdb to debug in vscode, it gives:
open tty -1
However, with command line gdb ./a.out, the file can be open successfully.
(gdb) r
Starting program: /home/miki0w0/c_test/a.out
open tty 3
[Inferior 1 (process 22818) exited normally]
(gdb) q
A same open issue can be found at https://stackoverflow.com/questions/52027368/unable-to-open-dev-ttyusb0-while-debugging-with-visual-studio-code-on-linux.
The vscode debugger works well in other cases. I wounder what causes the difference and how to fix it.
The environment is:
- OS and Version: Ubuntu 16.04
- VS Code Version: 1.32.3
- C/C++ Extension Version: 0.22.1
- Other extensions you installed (and if the issue persists after disabling them): None
Additional context
My configure file is:
launch.json.txt.
And the log information is included in this file:
debuglog.txt
- 主要言語
- TypeScript
- スター
- 6.2k
- フォーク
- 1.7k
- 平均マージ
- 14時間 46分
- マージ済み PR(30日)
- 61
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/vscode-cpptools のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
microsoft/vscode-cpptools#14787 ·
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared libraries オープンbug fixed Language Service regression
microsoft/vscode-cpptools#14779 · 担当者 1 名 ·
-
Language Service more info needed
microsoft/vscode-cpptools#14778 · コメント 1 件 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 64/100
microsoft/vscode-cpptools#14769 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
microsoft/vscode-cpptools#14768 · コメント 1 件 ·
microsoft/vscode-cpptools の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
area:tools bug good first issue help wanted priority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
TaewoooPark/Motifcode#14 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
newrelic-experimental/preflight#793 · コメント 1 件 ·
-
bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
BasedHardware/omi#15320 ·