We have a python app on Windows which we have packaged using pyinstaller. And now the scenario is, after running the built myapp.exe, we want to be able to attach to it and do some debugging using VS Code. This was originally working on our release version (let's say the bundle is myapp-release.exe) . However, after some modifications/upgrade, when we want to do the same thing to our latest development version (let's call it myapp-dev.exe), we got the error saying timed out waiting for debug server to connect. Basically we didn't change anything in our VS Code side (so the question title can also be like "VS Code is able to attach to one python process but fails with another one, using the same launch setting". The routine is, we start the myapp-release.exe/myapp-dev.exe outside of vs code. and launch an attach task defined in launch.json:

configurations": [
    {
        "name": "Python: Attach using Process Id",
        "type": "python",
        "request": "attach",
        "processId": "${command:pickProcess}"            
    }        
]

I know there is not really too much information given about the myapp itself. But my question is, where I can see the error logs abou the python attach procedure, to see why it fails to attach?

Thank you very much!

1

There are 1 best solutions below

1
On

You can configure logging as follow:

configurations": [
    {
        "name": "Python: Attach using Process Id",
        "type": "python",
        "request": "attach",
        "processId": "${command:pickProcess}",
        "logToFile": true        
    }        
]

The log files will be available in dir: ~/.vscode-server/extensions/ms-python.python-