forked from GoogleContainerTools/container-debug-support
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpydevd.patch
More file actions
68 lines (58 loc) · 2.49 KB
/
pydevd.patch
File metadata and controls
68 lines (58 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
diff --git _pydevd_bundle/pydevd_command_line_handling.py _pydevd_bundle/pydevd_command_line_handling.py
index 2afae09..2985a35 100644
--- _pydevd_bundle/pydevd_command_line_handling.py
+++ _pydevd_bundle/pydevd_command_line_handling.py
@@ -69,6 +69,7 @@ ACCEPTED_ARG_HANDLERS = [
ArgHandlerWithParam('client-access-token'),
ArgHandlerBool('server'),
+ ArgHandlerBool('continue'),
ArgHandlerBool('DEBUG_RECORD_SOCKET_READS'),
ArgHandlerBool('multiproc'), # Used by PyCharm (reuses connection: ssh tunneling)
ArgHandlerBool('multiprocess'), # Used by PyDev (creates new connection to ide)
diff --git pydevd.py pydevd.py
index 4639778..9ecfec0 100644
--- pydevd.py
+++ pydevd.py
@@ -1376,6 +1376,8 @@ class PyDB(object):
def run(self):
host = SetupHolder.setup['client']
+ if host is None:
+ host = ''
port = SetupHolder.setup['port']
self._server_socket = create_server_socket(host=host, port=port)
@@ -2240,7 +2242,7 @@ class PyDB(object):
from _pydev_bundle.pydev_monkey import patch_thread_modules
patch_thread_modules()
- def run(self, file, globals=None, locals=None, is_module=False, set_trace=True):
+ def run(self, file, globals=None, locals=None, is_module=False, set_trace=True, wait=True):
module_name = None
entry_point_fn = ''
if is_module:
@@ -2322,7 +2324,8 @@ class PyDB(object):
sys.path.insert(0, os.path.split(os_path_abspath(file))[0])
if set_trace:
- self.wait_for_ready_to_run()
+ if wait:
+ self.wait_for_ready_to_run()
# call prepare_to_run when we already have all information about breakpoints
self.prepare_to_run()
@@ -3276,14 +3279,21 @@ def main():
apply_debugger_options(setup)
+ wait = True
+ if setup['continue']:
+ wait = False
+
try:
- debugger.connect(host, port)
+ if wait:
+ debugger.connect(host, port)
+ else:
+ debugger.create_wait_for_connection_thread()
except:
sys.stderr.write("Could not connect to %s: %s\n" % (host, port))
pydev_log.exception()
sys.exit(1)
- globals = debugger.run(setup['file'], None, None, is_module)
+ globals = debugger.run(setup['file'], None, None, is_module, wait=wait)
if setup['cmd-line']:
debugger.wait_for_commands(globals)