Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
justynbell opened this issue Jan 8, 2025 · 2 comments
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@justynbell
Copy link

justynbell commented Jan 8, 2025

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

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jan 8, 2025
@justynbell
Copy link
Author

I just found this thread, it sounds like it's more likely my issue. Sorry about the noise.

@eleanorjboyd
Copy link
Member

Glad you found the upstream fix, no worries and happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants