Starts accepting connections at the given host/port. The debugger will not be initialized nor configured, it'll only start accepting connections (and will have the tracing setup in this thread). Meant to be used with the DAP (Debug Adapter Protocol) with _wait_for_attach(). :p
(
address,
dont_trace_start_patterns=(),
dont_trace_end_patterns=(),
patch_multiprocessing=False,
access_token=None,
client_access_token=None,
)
| 2869 | |
| 2870 | |
| 2871 | def _enable_attach( |
| 2872 | address, |
| 2873 | dont_trace_start_patterns=(), |
| 2874 | dont_trace_end_patterns=(), |
| 2875 | patch_multiprocessing=False, |
| 2876 | access_token=None, |
| 2877 | client_access_token=None, |
| 2878 | ): |
| 2879 | """ |
| 2880 | Starts accepting connections at the given host/port. The debugger will not be initialized nor |
| 2881 | configured, it'll only start accepting connections (and will have the tracing setup in this |
| 2882 | thread). |
| 2883 | |
| 2884 | Meant to be used with the DAP (Debug Adapter Protocol) with _wait_for_attach(). |
| 2885 | |
| 2886 | :param address: (host, port) |
| 2887 | :type address: tuple(str, int) |
| 2888 | """ |
| 2889 | host = address[0] |
| 2890 | port = int(address[1]) |
| 2891 | |
| 2892 | if SetupHolder.setup is not None: |
| 2893 | if port != SetupHolder.setup["port"]: |
| 2894 | raise AssertionError("Unable to listen in port: %s (already listening in port: %s)" % (port, SetupHolder.setup["port"])) |
| 2895 | settrace( |
| 2896 | host=host, |
| 2897 | port=port, |
| 2898 | suspend=False, |
| 2899 | wait_for_ready_to_run=False, |
| 2900 | block_until_connected=False, |
| 2901 | dont_trace_start_patterns=dont_trace_start_patterns, |
| 2902 | dont_trace_end_patterns=dont_trace_end_patterns, |
| 2903 | patch_multiprocessing=patch_multiprocessing, |
| 2904 | access_token=access_token, |
| 2905 | client_access_token=client_access_token, |
| 2906 | ) |
| 2907 | |
| 2908 | py_db = get_global_debugger() |
| 2909 | py_db.wait_for_server_socket_ready() |
| 2910 | return py_db._server_socket_name |
| 2911 | |
| 2912 | |
| 2913 | def _wait_for_attach(cancel=None): |
nothing calls this directly
no test coverage detected