mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Fix set next statement with DAP. Fixes #1163
This commit is contained in:
parent
6a785aba08
commit
fcf8cf6503
5 changed files with 34 additions and 42 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue