Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Could not stop at breakpoint when pathMappings.localRoot has slash #762

Closed
formulahendry opened this issue Aug 20, 2018 · 1 comment
Closed

Comments

@formulahendry
Copy link
Member

formulahendry commented Aug 20, 2018

Environment data

  • PTVSD version: 4.1.1a11
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Python2
  • Using VS Code or Visual Studio: VS Code

Actual behavior

Could not map file correctly to stop at breakpoint when pathMappings.localRoot has slash

Steps to reproduce:

  1. git clone https://github.com/formulahendry/python-amd64-debug.git
  2. docker build --rm -f Dockerfile.amd64.debug -t python-amd64-debug:latest .
  3. docker run -d -p 4000:3000 --name python-test python-amd64-debug:latest
  4. Attach the python code with the 3 configurations in launch.json
{
            "name": "Python Experimental: Attach (working)",
            "type": "pythonExperimental",
            "request": "attach",
            "port": 4000,
            "host": "localhost",
            "pathMappings": [{
                "localRoot": "${workspaceFolder}", // Local root  (where source and debugger running)
                "remoteRoot": "/app" // Remote root (where remote code is running)
            }]
        },
        {
            "name": "Python Experimental: Attach (sub folder) (working)",
            "type": "pythonExperimental",
            "request": "attach",
            "port": 4000,
            "host": "localhost",
            "pathMappings": [{
                "localRoot": "${workspaceFolder}\\test", // Local root  (where source and debugger running)
                "remoteRoot": "/app" // Remote root (where remote code is running)
            }]
        },
        {
            "name": "Python Experimental: Attach (sub folder) (not working)",
            "type": "pythonExperimental",
            "request": "attach",
            "port": 4000,
            "host": "localhost",
            "pathMappings": [{
                "localRoot": "${workspaceFolder}/test", // Local root  (where source and debugger running)
                "remoteRoot": "/app" // Remote root (where remote code is running)
            }]
        }
  1. The Python Experimental: Attach (sub folder) (not working) is not working, while other two work
    image
@brettcannon
Copy link
Member

brettcannon commented Aug 21, 2018

Our CTI also had an issue with ${workspaceFolder} where it ended up being translated to /C:/test/temotedebug.py (note the leading slash and path separators). When she set localRoot to C:\\test\\ it apparently worked. (She was trying remote debugging from Windows to Linux.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants