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

Source references not working #610

Closed
karthiknadig opened this issue Jul 7, 2018 · 7 comments
Closed

Source references not working #610

karthiknadig opened this issue Jul 7, 2018 · 7 comments

Comments

@karthiknadig
Copy link
Member

Environment data

  • PTVSD version: master
  • OS and version: windows to windows
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7
  • Using VS Code or Visual Studio: VSC

Actual behavior

Pausing while using remote only file (no path mapping) will bring up:
image

Expected behavior

Should use source reference to pull the remote file

Steps to reproduce:

On remote machine:

  1. Create this file remote_test.py:
import time
import ptvsd

ptvsd.enable_attach()

i = 0
while True:
    print(i)
    time.sleep(1)
    i += 1
  1. Ensure port 5678 has access for inbound connections.
  2. run py -3.7 remote_test.py

On dev machine:

  1. Use following launch config:
        {
            "name": "PyExp: Attach (Remote)",
            "type": "pythonExperimental",
            "request": "attach",
            "port": 5678,
            "host": "<remote-pc-name>",
            "logToFile": true
        },
  1. Select PyExp: Attach (Remote) to attach.
  2. Hit pause after attaching.
@DonJayamanne
Copy link
Contributor

@karthiknadig
This is the PR i was referring to #533
See comment here #473 (comment)

@DonJayamanne DonJayamanne self-assigned this Jul 7, 2018
@DonJayamanne
Copy link
Contributor

DonJayamanne commented Jul 9, 2018

@karthiknadig
As suspected, #533 broke this. In hindsight we shouldn't have merged the PR without testing this.

Anyways, I'll be looking into this.

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Jul 9, 2018

There are a number of problems that are contributing to this issue.
I'll address the first item.

Now, VSC is NOT sending this value, hence the value is expected to be false.

@fabioz
Copy link
Contributor

fabioz commented Jul 9, 2018

One thing from a quick look at the code is that CMD_LOAD_SOURCE was fixed on pydevd to convert the path to the server properly, but inside ptvsd.wrapper.VSCodeMessageProcessor.on_source it already used the private API to do a translation -- although it's probably not the culprit here it's an inconsistency added after #533 was merged.

@DonJayamanne
Copy link
Contributor

@fabioz I can see that #533 addresses a few issues we had in the past.
I think I've figured out what's going on, two fold, a bug at our end and we need to account for upstream pydevd changes (#533).

@fabioz
Copy link
Contributor

fabioz commented Jul 9, 2018

@DonJayamanne great, if you want me to take a look at something on my end, please let me know...

Right now I'm taking a look at #72, but I guess it's not that critical for a release and will still need more work on ptvsd to make it work, so, if you want to assign me some bug to take a look (even if it's on ptvsd and not pydevd), please let me know (as a note, it's actually already EOD for me today, so, I'll check it at Wednesday)

@karthiknadig
Copy link
Member Author

Note path mapping also has an issue:
This works:

"pathMappings": [
{"localRoot": "C:\\GIT\\pyscratch", "remoteRoot": "~/GIT"}
],

But this does not:

"pathMappings": [
{"localRoot": "${workspaceFolder}", "remoteRoot": "~/GIT"}
],

This is the error i see:
image

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

4 participants