Skip to content

Can't use ${workspaceFolder} when debugging from Windows on a Linux target #549

@justynbell

Description

@justynbell

I have a minimal Python example I'm running on a remote embedded Linux platform, in the /usr/bin/ directory:

Test.py:

import debugpy
from time import sleep

debugpy.listen(("0.0.0.0", 5678))
print("listening")

while True:
    sleep(1)

I'd like to be able to attach from a Windows host machine (I'm unfortunately forced to use Windows). My launch.json looks like this:

    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Remote Attach",
            "type": "debugpy",
            "request": "attach",
            "connect": {
                "host": "192.168.1.100",
                "port": 5678
            },
            "pathMappings": [
                {
                    "localRoot": "c:\\dev\\test\\",
                    //"localRoot": "${workspaceFolder}",
                    "remoteRoot": "/usr/bin/",
                }
            ],
            "justMyCode": false
        }
    ]

If I use my hard-coded Windows source path (c:\\dev\\test\\) it works: I can set breakpoints, step through code, etc. C:\dev\test is the location of my project on my Windows PC.
But that's not very portable. If I use localRoot": "${workspaceFolder}", the pydev debugger outputs the following:

pydev debugger: unable to find translation for: "c:\dev\test\Test.py" in ["C:\dev\test/", "C:\dev\test"] (please revise your path mappings).

I'm not even sure WHAT is "looking" for the c:\dev\test\Test.py path (the first path in the pydev error). The problem is obviously that it doesn't like "c" vs "C". Is this a bug in the VSCode python-debugger plugin?

Versions:

VSCode: 1.96.2
Python Debugger: 2024-12-11
pydebug (on remote): 1.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage-neededNeeds assignment to the proper sub-team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions