forked from microsoft/ptvsd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
microsoft#72: Provide a way to set breakpoint suspension policy.
- Loading branch information
Showing
8 changed files
with
123 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
ptvsd/_vendored/pydevd/tests_python/resources/_debugger_case_remote.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
if __name__ == '__main__': | ||
import os | ||
import sys | ||
port = int(sys.argv[1]) | ||
root_dirname = os.path.dirname(os.path.dirname(__file__)) | ||
|
||
if root_dirname not in sys.path: | ||
sys.path.append(root_dirname) | ||
|
||
import pydevd | ||
print('before pydevd.settrace') | ||
pydevd.settrace(port=8787) | ||
pydevd.settrace(port=port) | ||
print('after pydevd.settrace') | ||
print('TEST SUCEEDED!') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
ptvsd/_vendored/pydevd/tests_python/resources/_debugger_case_remote_unhandled_exceptions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
if __name__ == '__main__': | ||
import os | ||
import sys | ||
port = int(sys.argv[1]) | ||
root_dirname = os.path.dirname(os.path.dirname(__file__)) | ||
|
||
if root_dirname not in sys.path: | ||
sys.path.append(root_dirname) | ||
|
||
import pydevd | ||
print('before pydevd.settrace') | ||
pydevd.settrace(port=8787) | ||
pydevd.settrace(port=port) | ||
print('after pydevd.settrace') | ||
raise ValueError('TEST SUCEEDED!') | ||
|
3 changes: 2 additions & 1 deletion
3
ptvsd/_vendored/pydevd/tests_python/resources/_debugger_case_remote_unhandled_exceptions2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
ptvsd/_vendored/pydevd/tests_python/resources/_debugger_case_suspend_policy.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import threading | ||
|
||
semaphore1 = threading.Semaphore(0) | ||
lock = threading.Lock() | ||
proceed = False | ||
|
||
|
||
def thread_target(): | ||
semaphore1.release() | ||
import time | ||
|
||
while True: | ||
with lock: | ||
if proceed: | ||
break | ||
time.sleep(1 / 30.) | ||
|
||
|
||
for i in range(2): | ||
t = threading.Thread(target=thread_target) | ||
t.start() | ||
|
||
semaphore1.acquire() # let first thread run | ||
semaphore1.acquire() # let second thread run | ||
|
||
# At this point we know both other threads are already running. | ||
print('break here') | ||
|
||
with lock: | ||
proceed = True | ||
|
||
print('TEST SUCEEDED!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters