Add "run to cursor" support

We add a 'temporary' option to line breakpionts and try and clear any
temporary breakpionts on the line we end up stopping on. This might not
be art, but _probably_ works in almost all cases that matter.

it's a bit hacky the way we have to push the reason around, but we don't
know where we stopped until we actually get the stack trace response and
SetCurrentFrame

Move temporary breakpionts to match server response

Also delete any existing ones when adding a new one and add tests for
run-to-cursor.

Only continue after we successfully set the breakpoints. This makes it
work in go
This commit is contained in:
Ben Jackson 2020-10-13 22:43:52 +01:00
commit 80985148e7
18 changed files with 693 additions and 205 deletions

View file

@ -52,6 +52,11 @@
},
"run - default": {
"adapter": "debugpy",
"variables": {
"MAKE_ENV_OUTPUT": {
"shell": "${workspaceRoot}/make_env.sh"
}
},
"configuration": {
"request": "launch",
"type": "python",
@ -60,8 +65,8 @@
"stopOnEntry#json": "${StopOnEntry:true}",
"console": "integratedTerminal",
"args#json": "${args:[]}",
"env#json": "${env:{\\}}",
"igored#json#s": "string not json"
"igored#json#s": "string not json",
"env#json": "${MAKE_ENV_OUTPUT}"
},
"breakpoints": {
"exception": {

View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
cat <<"EOF"
{
"Something": "Value1",
"SomethingElse": "Value2"
}
EOF

View file

@ -0,0 +1,15 @@
#!/usr/bin/env python
import os
def Main():
print( os.environ.get( 'Something', 'ERROR' ) )
print( os.environ.get( 'SomethingElse', 'ERROR' ) )
for k, v in os.environ:
print( f'{ k } = "{ v }"' )
Main()