Support "multi-session" mode properly

Document remote debugging and add a test
This commit is contained in:
Ben Jackson 2020-05-15 15:18:06 +01:00 committed by Ben Jackson
commit c6d6c7f876
12 changed files with 417 additions and 36 deletions

View file

@ -2,7 +2,7 @@
"configurations": {
// This is a comment.
"run legacy vscode-python": {
"adapter": "vscode-python" /* coment goes here too */,
"adapter": "vscode-python", /* coment goes here too */
"configuration": {
"request": "launch",
"type": "python",
@ -19,12 +19,9 @@
}
},
"attach": {
"adapter": "debugpy",
"adapter": "multi-session",
"configuration": {
"request": "attach",
"type": "python",
"host": "localhost",
"port": "5678"
"request": "attach"
},
"breakpoints": {
"exception": {

View file

@ -1 +1 @@
ptvsd==4.3.2
debugpy

View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
PYTHON=python3
if [ -n "$1" ]; then
PYTHON=$1
fi
pushd $(dirname $0)
if [ -d env ]; then
rm -rf env
fi
$PYTHON -m venv env
. env/bin/activate
python -m pip install -r requirements.txt
echo "*** Launching ***"
python -m debugpy --wait-for-client --listen 0.0.0.0:5678 main.py
popd

View file

@ -1,19 +0,0 @@
#!/usr/bin/env bash
PYTHON=python3
if [ -n "$1" ]; then
PYTHON=$1
fi
pushd $(dirname $0)
if [ ! -d env ]; then
virtualenv -p $PYTHON env
fi
. env/bin/activate
pip install -r requirements.txt
python -m ptvsd --wait --host localhost --port 5678 main.py
popd