Fix set next statement with DAP. Fixes #1163

This commit is contained in:
fabioz 2019-03-19 16:27:09 -03:00 committed by Fabio Zadrozny
parent 6a785aba08
commit fcf8cf6503
5 changed files with 34 additions and 42 deletions

View file

@ -12,17 +12,18 @@ from tests.helpers.timeline import Event
from tests.helpers.pattern import ANY
@pytest.mark.skip(reason='https://github.com/Microsoft/ptvsd/issues/1163')
def test_set_next_statement(pyfile, run_as, start_method):
@pyfile
def code_to_debug():
from dbgimporter import import_and_enable_debugger
import_and_enable_debugger()
def func():
print(1) #@inner1
print(2) #@inner2
print(3) #@outer3
print(1) # @inner1
print(2) # @inner2
print(3) # @outer3
func()
line_numbers = get_marked_line_numbers(code_to_debug)

View file

@ -11,15 +11,14 @@ import threading
import time
import traceback
if sys.version_info >= (3, 5):
clock = time.monotonic
else:
clock = time.clock
timestamp_zero = clock()
def timestamp():
return clock() - timestamp_zero
@ -83,7 +82,7 @@ def get_marked_line_numbers(path):
with open(path) as f:
lines = {}
for i, line in enumerate(f):
match = re.search(r'#@\s*(.*?)\s*$', line)
match = re.search(r'#\s*@\s*(.*?)\s*$', line)
if match:
marker = match.group(1)
lines[marker] = i + 1