Skip to content

ptvsd not detecting symlink and setting unverified breakpoints #135

@DonJayamanne

Description

@DonJayamanne

From @yajo on July 3, 2017 9:55

Environment data

VS Code version: 1.13.1
Python Extension version: 0.6.7
Python Version: 2.7
OS and version: Fedora 25, connecting to a dockerized Debian 8

Actual behavior

When localRoot and remoteRoot correctly match, but Python loads addons from a symlinked path, that is not detected and breakpoints become unverified. As such, I cannot step through the code normally.

Expected behavior

ptvsd should detect when the code is reached, either directly or from a symlinked path.

Steps to reproduce:

  • Create a project and create a python file called mytest.py:

    def somemethod():
        pass
  • From VSCode add a breakpoint inside somemethod().

  • Create a Dockerfile like:

    FROM python:2.7-alpine
    RUN pip install --no-cache ptvsd==3.0.0
    RUN mkdir -p /src /dst/modules
    RUN touch /dst/modules/__init__.py
    RUN ln -s /src/mytest.py /dst/modules/
    RUN echo 'from .modules.mytest import somemethod; somemethod()' > /dst/importer.py
    CMD python -m ptvsd -s my_secret -p 6899 --wait /dst/importer.py
  • Run the docker environment mounting your code in /src:

    docker build --tag test .
    docker run -it --rm -v $(pwd):/src -p 127.0.0.1:6899:6899 test
    
  • Connect from VSCode pressing F5 (check launch.json below).

  • You will see that vscode debugs, but the breakpoint appears as unverified, and you are not able to properly debug.

Settings

Your launch.json (if dealing with debugger issues):

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Run and debug",
            "type": "python",
            "request": "attach",
            "localRoot": "${workspaceRoot}",
            "remoteRoot": "/src",
            "port": 6899,
            "secret": "my_secret",
            "host": "localhost"
        }
    ]
}

Your settings.json:

{
    "python.formatting.provider": "yapf"
}

Logs

Output from Python output panel: nothing relevant.

Output from Console window (Help->Developer Tools menu): Nothing relevant.

Copied from original issue: DonJayamanne/pythonVSCode#1065

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-debuggingbugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions