Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Remotely debug Python code on Linux from Microsoft Visual Studio 2022: cannot set breakpoint (Breakpoint in file that does not exist)

オープン
#1,599 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
devtools

調査の方向性

まず、この報告を debugpy issue 1240 および Microsoft Visual Studio 2022 のリモート デバッグ設定と比較します。Windows パス C:\pro\XtsUpdater と Linux パス /home/bha/pro/XtsUpdater を使用し、debugpy.listen()、debugpy.wait_for_client()、debugpy.breakpoint() で例を再現します。手動で設定した Visual Studio のブレークポイントが解決され、実行が停止すれば完了です。

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

説明

Hi,
This one looks like https://github.com/microsoft/debugpy/issues/1240 but as i'm using Microsoft Visual studio 2022 and not Visual code, i cannot specify file path mapping or i don't know how to di it.
The problems seems to come from the fact that the file path on my windows machine is not the same than thge one on my linux ubuntu machine. The file names and content are equal.

Environment data

-debugpy==1.8.1

  • Windows 11/ Linux Ubuntu
  • Python version 3.10
  • Using Visual Studio:

Actual behavior

  • Breakpoint manually set in microsoft visual studio ide are not fill red bullet (not set with message 'Breakpoint in file that does not exist')
  • Breakpoint set in python code by debugpy.breakpoint(); works and i can step in my code and see variables content

Expected behavior

Breakpoint manually set in microsoft visual studio ide should be full red bullet and should stop the app when hitted :-)

I suspect that the problem comes from the fact that the sources code files are not located in the same path in the host and remote machine:
-windows: C:\pro\XtsUpdater
-linux: /home/bha/pro/XtsUpdater

With Vscode you can specify file path mapping in launch.json but how to do this in Microsoft visual studio 2020 ???

Code

from flask import Flask
import socket
xts_updater_service = Flask(name)

import debugpy

@xts_updater_service.route('/')
def hello_world():
debugpy.breakpoint();
hostname = socket.gethostname()
message = "Hello world from '" + hostname + "'\n"
return message

if name == 'main':
print(f"Starting Debug Lister on port 5678")
debugpy.listen(('0.0.0.0', 5678))
print("Waiting for debugger attach")
debugpy.wait_for_client()
debugpy.breakpoint();
print(f"Launch http server on port 8081")
xts_updater_service.run(host='0.0.0.0', port=8081
)

主要言語
Python
スター
2.5k
フォーク
202
平均マージ
5日 1時間
マージ済み PR(30日)
1

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

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

はじめの一歩

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

microsoft/debugpy のほかの issue

microsoft/debugpy の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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