-
Couldn't load subscription status.
- Fork 30
Add support for pydevd --continue
#74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
briandealwis
merged 3 commits into
GoogleContainerTools:duct-tape
from
briandealwis:pydevd-continue
May 18, 2021
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,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']: | ||
briandealwis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| + wait = False | ||
| + | ||
| try: | ||
| - debugger.connect(host, port) | ||
| + if wait: | ||
briandealwis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| + 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) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for my understanding - how will this get passed in? does skaffold hardcode this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is from the
--waitflag. It's currently not supported in Skaffold (GoogleContainerTools/skaffold#4870).