{"action":"created","issue":{"url":"https://api.github.com/repos/DonJayamanne/pythonVSCode/issues/252","repository_url":"https://api.github.com/repos/DonJayamanne/pythonVSCode","labels_url":"https://api.github.com/repos/DonJayamanne/pythonVSCode/issues/252/labels{/name}","comments_url":"https://api.github.com/repos/DonJayamanne/pythonVSCode/issues/252/comments","events_url":"https://api.github.com/repos/DonJayamanne/pythonVSCode/issues/252/events","html_url":"https://github.com/DonJayamanne/pythonVSCode/issues/252","id":171064800,"number":252,"title":"Cross platform remote debugging breakpoint not working (and workaround)","user":{"login":"jackqq","id":7012225,"avatar_url":"https://avatars.githubusercontent.com/u/7012225?v=3","gravatar_id":"","url":"https://api.github.com/users/jackqq","html_url":"https://github.com/jackqq","followers_url":"https://api.github.com/users/jackqq/followers","following_url":"https://api.github.com/users/jackqq/following{/other_user}","gists_url":"https://api.github.com/users/jackqq/gists{/gist_id}","starred_url":"https://api.github.com/users/jackqq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackqq/subscriptions","organizations_url":"https://api.github.com/users/jackqq/orgs","repos_url":"https://api.github.com/users/jackqq/repos","events_url":"https://api.github.com/users/jackqq/events{/privacy}","received_events_url":"https://api.github.com/users/jackqq/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/DonJayamanne/pythonVSCode/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/DonJayamanne/pythonVSCode/milestones/1","html_url":"https://github.com/DonJayamanne/pythonVSCode/milestones/September","labels_url":"https://api.github.com/repos/DonJayamanne/pythonVSCode/milestones/1/labels","id":1960125,"number":1,"title":"September","description":"","creator":{"login":"DonJayamanne","id":1948812,"avatar_url":"https://avatars.githubusercontent.com/u/1948812?v=3","gravatar_id":"","url":"https://api.github.com/users/DonJayamanne","html_url":"https://github.com/DonJayamanne","followers_url":"https://api.github.com/users/DonJayamanne/followers","following_url":"https://api.github.com/users/DonJayamanne/following{/other_user}","gists_url":"https://api.github.com/users/DonJayamanne/gists{/gist_id}","starred_url":"https://api.github.com/users/DonJayamanne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DonJayamanne/subscriptions","organizations_url":"https://api.github.com/users/DonJayamanne/orgs","repos_url":"https://api.github.com/users/DonJayamanne/repos","events_url":"https://api.github.com/users/DonJayamanne/events{/privacy}","received_events_url":"https://api.github.com/users/DonJayamanne/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":10,"state":"open","created_at":"2016-08-24T09:59:35Z","updated_at":"2016-09-09T01:01:00Z","due_on":"2016-09-05T00:00:00Z","closed_at":null},"comments":10,"created_at":"2016-08-14T15:49:20Z","updated_at":"2016-09-09T01:16:10Z","closed_at":"2016-09-09T01:01:00Z","body":"I've been trying to debug a hello-world Python program on Linux remotely from Windows using VSCode and this extension. However, breakpoint was not working, caused by 2 problems.\r\n\r\nBy printing arguments in ptvsd (BreakpointInfo.__init__()) on Linux, I learned that it was instructed to break in 'c:\\root\\python\\test.py' on Linux, which made nonsense.\r\n\r\nThe local source file path turns out to be translated to remote path at line 367 (convertClientPathToDebugger) of src/client/debugger/Main.ts of this extenstion, but the call to path.resolve assumes we are on Windows, so it adds c: to the beginning.\r\n\r\nBy changing the call to path.posix.resolve, I came to the workaround to the first problem.\r\n```\r\nreturn path.posix.resolve(this.attachArgs.remoteRoot, pathRelativeToClientRoot);\r\n```\r\n\r\nThen, although the breakpoint was set, ptvsd just wouldn't break there. By printing from ptvsd (DebuggerLoop.loop()), I learned that it was first instructed to 'rest', i.e. resume thread, and then without much chance to catch up, a 'brkt' instruction came, often after the desired breakpoint had passed.\r\n\r\nAt line 149 (onPythonProcessLoaded) of Main.ts, by changing the behavior in the else clause from sending resume thread to sending stop at entry, I came to the workaround to the second problem.\r\n```\r\nelse {\r\n    this.sendEvent(new StoppedEvent(\"entry\", pyThread.Id));\r\n//    this.pythonProcess.SendResumeThread(pyThread.Id);\r\n}\r\n```\r\n\r\nObviously the above two are just workarounds, and would definitely cause other problems, on Windows, of course! I would like to put them forward here as a reference, in hope of helping us to a proper solution. Thanks!\r\n"},"comment":{"url":"https://api.github.com/repos/DonJayamanne/pythonVSCode/issues/comments/245790933","html_url":"https://github.com/DonJayamanne/pythonVSCode/issues/252#issuecomment-245790933","issue_url":"https://api.github.com/repos/DonJayamanne/pythonVSCode/issues/252","id":245790933,"user":{"login":"jackqq","id":7012225,"avatar_url":"https://avatars.githubusercontent.com/u/7012225?v=3","gravatar_id":"","url":"https://api.github.com/users/jackqq","html_url":"https://github.com/jackqq","followers_url":"https://api.github.com/users/jackqq/followers","following_url":"https://api.github.com/users/jackqq/following{/other_user}","gists_url":"https://api.github.com/users/jackqq/gists{/gist_id}","starred_url":"https://api.github.com/users/jackqq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackqq/subscriptions","organizations_url":"https://api.github.com/users/jackqq/orgs","repos_url":"https://api.github.com/users/jackqq/repos","events_url":"https://api.github.com/users/jackqq/events{/privacy}","received_events_url":"https://api.github.com/users/jackqq/received_events","type":"User","site_admin":false},"created_at":"2016-09-09T01:16:10Z","updated_at":"2016-09-09T01:16:10Z","body":"> Please ensure you have the same code at both (client and server) ends.\r\n\r\nYes, I'm pretty sure about this.\r\n\r\n> I suppose the use of break_into_debugger is the solution.\r\n\r\nThanks for the standard solution!\r\n"}}
{"actor":{"display_login":"jackqq"}}