Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#1,599 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
python
Área
devtools

Línea de trabajo

Comienza comparando este informe con debugpy issue 1240 y con la configuración de depuración remota de Microsoft Visual Studio 2022. Reproduce el ejemplo usando debugpy.listen(), debugpy.wait_for_client() y debugpy.breakpoint(), con la ruta de Windows C:\pro\XtsUpdater y la ruta de Linux /home/bha/pro/XtsUpdater. Se considera terminado cuando los puntos de interrupción de Visual Studio establecidos manualmente se resuelven y detienen la ejecución.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
)

Lenguaje dominante
Python
Estrellas
2.5k
Forks
202
Merge medio
5 d 1 h
PR fusionados (30 d)
1

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/debugpy

Todos los issues de microsoft/debugpy

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.