Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Cannot set remote breakpoints in Visual Studio Community 2022 (Version 17.9.3)

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

还没有人认领这个 Issue。

评估

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

调研方向

从 debugpy/_vendored/pydevd/pydevd_file_utils.py 开始,尤其检查 set_ide_os(os),并将随附的 adapter、pydevd 和 server 日志与报告中的路径转换步骤进行比较。使用列出的环境复现从 Windows 到 Ubuntu 的远程附加,并检查转换后路径周围的斜杠转换。完成标准是:连接前设置的断点和连接后设置的断点都解析到 /home/shamada/debug/b.py,而不是报告文件不存在。

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

描述

Symptoms

Remote debugging using VS2022+debugpy does not work properly.
The remote connection is successful, but Breakpoint cannot be set.

Environmental Data

Client environment
  • Windows-10
  • Visual Studio Community 2022 (ver 17.9.3)
  • debugpy 1.8.0
  • workdir: \10.123.36.238\shamada\debug\
Server environment
  • Ubuntu-22.0.4
  • Python 3.11.5
  • debugpy 1.8.0
  • workdir: /home/shamada/debug/

Execution steps and results

Execution steps

[server side]

export DEBUGPY_LOG_DIR="/home/shamada/debug"
export DEBUG_PYDEVD_PATHS_TRANSLATION=1
export PATHS_FROM_ECLIPSE_TO_PYTHON='[["\\\\10.123.36.238\\shamada\\", "/home/shamada/"]]'
conda activate py311a
python -Xfrozen_modules=off -m debugpy --wait-for-client --listen 0.0.0.0:5678 b.py

[cliennt side]
execute "attach to process"
execute "python remote (debugpy)"

Results

Pre-set breakpoints will be disabled.
Breakpoints set after connection are also disabled.
Both breakpoints are given the error message "Breakpoint in file that does not exist."

Investigation

debugpy.pydevd.log contains logs like the following.

0.00s - Request for breakpoint in: \\10.123.36.238\shamada\debug\b.py line: 3
0.00s - pydev debugger: replacing to server: \\10.123.36.238\shamada\debug\b.py
0.00s - pydev debugger: sent to server: /home/shamada/debug\b.py - matched prefix: \\10.123.36.238\shamada\
0.00s - Breakpoint (after path translation) in: /home/shamada/debug\b.py line: 3
0.00s - os.path.exists('/home/shamada/debug\\b.py') returned False.

It seems that the cause is that slashes and backslashes are not converted properly in path mapping.

Please see the attached file for all logs.
debugpy.adapter-4104855.log
debugpy.pydevd.4104847.log
debugpy.server-4104847.log

Additional attempts

Referring to the previous issue below, I modified the system file below on both the client and server.
Cannot set remote breakpoints in Visual Studio Community 2019 (Version 16.6.1)

File: debugpy/_vendored/pydevd/pydevd_file_utils.py
Location: in set_ide_os(os) function

Add the following.
os = 'WINDOWS'

The symptoms did not change.

主要语言
Python
星标
2.5k
派生
202
平均合并
5 天 1 小时
30 天内合并 PR
1

贡献指南

打开贡献指南

从这里开始

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

microsoft/debugpy 的其他 Issue

查看 microsoft/debugpy 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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