microsoft / ptvsd

Python debugger package for use with Visual Studio and Visual Studio Code.
Other
550 stars 68 forks source link

pydev debugger: warning: trying to add breakpoint to file that does not exist #1936

Closed blackchoey closed 4 years ago

blackchoey commented 4 years ago

Environment data

Expected behaviour

No warning should exist in VS Code debug console when debug

Actual behaviour

Warning pydev debugger: warning: trying to add breakpoint to file that does not exist: xxx is outputted to VS Code debug console. But the breakpoint can be hit.

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Insatll VS Code Azure IoT Edge extension
  2. Invoke command "Azure IoT Edge: New IoT Edge Solution", choose Python Module when selecting module template. Leave default values for all other fields.
  3. Add ptvsd realted code into modules/SampleModule/main.py
  4. Right click on file deployment.debug.template.json, choose Build and Run IoT Edge solution in simulator. A docker container will start to execute the python code.
  5. Click Debug in VS Code activity bar, choose configuration SampleModule Remote Debug (Python) and start debug
  6. Check the output of VS Code debug console, the warning mentioned above will be outputted there

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Nothing surprise in the logs.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

No logs from Console

fabioz commented 4 years ago

That's pretty strange... the debugger should only print this if os.path.exists(file) == False... Can you check there if os.path.exists with that file really does return False?

Also, can you provide the pydevd logs you have when running it? To obtain those, please add the following environment variables to the launch:

PYDEVD_DEBUG=True
PYDEVD_DEBUG_FILE=/path/to/log/pydevd.log

Ensure that /path/to/log directory exists before running (and remove any personal information from the log files).

int19h commented 4 years ago

Unable to reproduce or investigate the issue further without logs. Please re-open if you're still seeing it with the most recent version of the debugger.