debugpy 1.8.5__zip → 1.8.7__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {debugpy-1.8.5/src/debugpy.egg-info → debugpy-1.8.7}/PKG-INFO +1 -1
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_calltip_util.py +19 -21
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_completer.py +30 -30
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_execfile.py +3 -1
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_filesystem_encoding.py +43 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_getopt.py +35 -32
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_imports_tipper.py +83 -84
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_jy_imports_tipper.py +92 -99
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_log.py +2 -3
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_saved_modules.py +51 -27
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_sys_patch.py +11 -7
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_tipper_common.py +6 -5
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/fsnotify/__init__.py +34 -38
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_console_utils.py +71 -69
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_import_hook.py +1 -3
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_imports.py +0 -1
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_ipython_console.py +14 -16
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_ipython_console_011.py +81 -93
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_is_thread_alive.py +3 -3
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_localhost.py +9 -8
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_log.py +33 -25
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py +183 -170
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey_qt.py +33 -29
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_override.py +6 -4
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_umd.py +19 -18
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_versioncheck.py +3 -3
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles.py +165 -138
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_coverage.py +77 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_nose.py +35 -36
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_parallel.py +22 -23
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_parallel_client.py +37 -57
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_pytest2.py +54 -52
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_unittest.py +28 -37
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_xml_rpc.py +56 -53
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/__main__pydevd_gen_debug_adapter_protocol.py +604 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/debugProtocol.json +551 -445
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_base_schema.py +25 -29
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_schema.py +17458 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_schema_log.py +11 -12
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevconsole_code.py +18 -19
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_additional_thread_info.py +41 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_additional_thread_info_regular.py +328 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_api.py +263 -214
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_breakpoints.py +7 -10
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_bytecode_utils.py +187 -92
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_bytecode_utils_py311.py +105 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_code_to_source.py +46 -51
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_collect_bytecode_info.py +239 -176
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py +370 -297
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm_constants.py +78 -86
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_command_line_handling.py +55 -59
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_concurrency_analyser/pydevd_concurrency_logger.py +194 -58
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_concurrency_analyser/pydevd_thread_wrappers.py +2 -3
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_console.py +18 -23
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_constants.py +159 -127
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_custom_frames.py +10 -12
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.c +55527 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.pxd +15 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.pyx +803 -511
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython_wrapper.py +18 -7
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_daemon_thread.py +32 -24
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_defaults.py +11 -13
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_dont_trace.py +16 -16
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_dont_trace_files.py +27 -2
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_exec2.py +1 -1
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_extension_api.py +4 -5
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_extension_utils.py +8 -10
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_filtering.py +50 -45
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_frame.py +462 -407
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_frame_utils.py +69 -61
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_gevent_integration.py +14 -16
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_import_class.py +27 -25
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_io.py +40 -42
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_json_debug_options.py +200 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command.py +20 -19
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_json.py +199 -108
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_xml.py +121 -73
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_plugin_utils.py +208 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command.py +206 -159
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command_json.py +346 -334
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_referrers.py +75 -80
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_reload.py +35 -35
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_resolver.py +116 -124
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py +44 -58
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_safe_repr.py +51 -55
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_save_locals.py +4 -2
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_signature.py +24 -24
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_source_mapping.py +19 -20
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_stackless.py +45 -49
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_suspended_frames.py +61 -58
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_thread_lifecycle.py +23 -13
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_timeout.py +29 -31
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_trace_dispatch.py +41 -11
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_trace_dispatch_regular.py +117 -55
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_traceproperty.py +11 -14
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_utils.py +90 -89
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vars.py +106 -97
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vm_type.py +40 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_xml.py +56 -46
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_cython_wrapper.py +5 -5
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_main.py +71 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.c +11165 -5326
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_tracing.py +5 -6
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_modify_bytecode.py +53 -56
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/__init__.py +1 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/bytecode.py +4 -6
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/cfg.py +6 -26
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/concrete.py +7 -21
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/flags.py +5 -24
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/instr.py +10 -34
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/peephole_opt.py +1 -4
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/__init__.py +2 -6
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_bytecode.py +3 -5
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_cfg.py +11 -31
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_code.py +2 -2
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_concrete.py +14 -41
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_flags.py +2 -4
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_instr.py +7 -18
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_misc.py +6 -18
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_peephole_opt.py +7 -18
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/util_annotation.py +1 -3
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/pydevd_fix_code.py +14 -19
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/_pydevd_sys_monitoring.py +1929 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/_pydevd_sys_monitoring_cython.c +43253 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/_pydevd_sys_monitoring_cython.pxd +46 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/_pydevd_sys_monitoring_cython.pyx +1935 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/pydevd_sys_monitoring.py +16 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_app_engine_debug_startup.py +12 -11
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_coverage.py +30 -32
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhook.py +58 -54
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookglut.py +20 -24
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookgtk.py +8 -7
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookgtk3.py +8 -6
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookpyglet.py +11 -8
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookqt4.py +21 -18
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookqt5.py +17 -15
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookqt6.py +17 -15
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhooktk.py +6 -4
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookwx.py +14 -10
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/matplotlibtools.py +30 -26
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydev_ipython/qt.py +24 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/qt_for_kernel.py +37 -34
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/qt_loaders.py +86 -73
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/version.py +7 -7
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydev_pysrc.py +1 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_run_in_console.py +23 -24
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydev_sitecustomize/sitecustomize.py +267 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevconsole.py +55 -47
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd.py +732 -508
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_always_live_program.py +40 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_check.py +1 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_test_attach_to_process.py +11 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_test_attach_to_process_linux.py +75 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py +130 -125
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.dll +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.pdb +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_pydevd.py +89 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_script.py +41 -32
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.dll +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.pdb +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_utils.hpp +1 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_version.hpp +9 -1
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.exe +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.pdb +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.exe +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.pdb +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/lldb_prepare.py +10 -9
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.dll +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.pdb +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.dll +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.pdb +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/__init__.py +103 -119
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/breakpoint.py +457 -516
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/compat.py +33 -15
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/crash.py +336 -281
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/debug.py +101 -131
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/disasm.py +148 -153
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/event.py +310 -302
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/interactive.py +235 -208
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/module.py +185 -218
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/process.py +428 -564
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/registry.py +54 -53
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/search.py +69 -73
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/sql.py +158 -170
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/system.py +143 -213
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/textio.py +302 -333
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/thread.py +220 -239
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/util.py +198 -177
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/__init__.py +11 -11
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/advapi32.py +1191 -713
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/context_amd64.py +248 -194
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/context_i386.py +132 -120
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/dbghelp.py +450 -346
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/defines.py +305 -286
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/gdi32.py +526 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/kernel32.py +1479 -1097
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/ntdll.py +579 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/peb_teb.py +3517 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/psapi.py +54 -31
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/shell32.py +170 -149
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/shlwapi.py +190 -108
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/user32.py +542 -437
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/version.py +489 -442
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/wtsapi32.py +83 -65
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/window.py +70 -76
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/attach.cpp +17 -9
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/compile_windows.bat +1 -1
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_file_utils.py +141 -120
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/__init__.py +1 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/django_debug.py +175 -149
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/__init__.py +1 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/__init__.py +1 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_helpers.py +5 -5
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_plugin_numpy_types.py +28 -28
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_plugin_pandas_types.py +22 -30
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_plugins_django_form_str.py +3 -2
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/jinja2_debug.py +130 -108
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/pydevd_line_validation.py +27 -14
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_tracing.py +85 -66
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/setup_pydevd_cython.py +96 -59
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_version.py +3 -3
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/messaging.py +2 -1
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/server/cli.py +32 -17
- {debugpy-1.8.5 → debugpy-1.8.7/src/debugpy.egg-info}/PKG-INFO +1 -1
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy.egg-info/SOURCES.txt +6 -1
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_filesystem_encoding.py +0 -41
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_coverage.py +0 -76
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/__main__pydevd_gen_debug_adapter_protocol.py +0 -592
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_schema.py +0 -19514
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_additional_thread_info.py +0 -19
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_additional_thread_info_regular.py +0 -153
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.c +0 -43377
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_json_debug_options.py +0 -204
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_plugin_utils.py +0 -91
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_trace_api.py +0 -62
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vm_type.py +0 -41
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_main.py +0 -48
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydev_ipython/qt.py +0 -23
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydev_pysrc.py +0 -1
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydev_sitecustomize/sitecustomize.py +0 -237
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_always_live_program.py +0 -32
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_test_attach_to_process.py +0 -9
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_test_attach_to_process_linux.py +0 -74
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.dll +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.pdb +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_pydevd.py +0 -79
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.dll +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.pdb +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.exe +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.pdb +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.pdb +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.dll +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.pdb +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.dll +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.pdb +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/gdi32.py +0 -507
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/ntdll.py +0 -539
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/peb_teb.py +0 -3435
- {debugpy-1.8.5 → debugpy-1.8.7}/DESCRIPTION.md +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/LICENSE +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/MANIFEST.in +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/README.md +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/pyproject.toml +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/setup.cfg +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/setup.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/ThirdPartyNotices.txt +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/__main__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/_pydevd_packaging.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/_util.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/force_pydevd.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/debugProtocolCustom.json +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_concurrency_analyser/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/.gitignore +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pxd +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pyx +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.template.pyx +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/release_mem.h +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/README.txt +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/README +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_sitecustomize/__not_in_default_pythonpath.txt +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/README.txt +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace_310.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace_311.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace_common.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_settrace.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/python.h +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/ref_utils.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/.gitignore +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/attach.cpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_linux.sh +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_mac.sh +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_manylinux.cmd +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/attach.h +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/inject_dll.cpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/py_win_helpers.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/run_code_in_memory.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/run_code_on_dllmain.cpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/stdafx.cpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/stdafx.h +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/targetver.h +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/README.md +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/adapter/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/adapter/__main__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/adapter/clients.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/adapter/components.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/adapter/launchers.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/adapter/servers.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/adapter/sessions.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/json.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/log.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/singleton.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/sockets.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/stacks.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/timestamp.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/util.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/launcher/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/launcher/__main__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/launcher/debuggee.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/launcher/handlers.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/launcher/output.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/launcher/winapi.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/public_api.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/server/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/server/api.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/server/attach_pid_injected.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy.egg-info/dependency_links.txt +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy.egg-info/entry_points.txt +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy.egg-info/top_level.txt +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/versioneer.py +0 -0
debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/_pydevd_sys_monitoring_cython.pyx
ADDED
|
@@ -0,0 +1,1935 @@
|
|
|
1
|
+
from __future__ import print_function
|
|
2
|
+
|
|
3
|
+
# Important: Autogenerated file.
|
|
4
|
+
|
|
5
|
+
# DO NOT edit manually!
|
|
6
|
+
# DO NOT edit manually!
|
|
7
|
+
# Copyright: Brainwy Software
|
|
8
|
+
#
|
|
9
|
+
# License: EPL
|
|
10
|
+
|
|
11
|
+
from collections import namedtuple
|
|
12
|
+
import dis
|
|
13
|
+
import os
|
|
14
|
+
import re
|
|
15
|
+
import sys
|
|
16
|
+
from _pydev_bundle._pydev_saved_modules import threading
|
|
17
|
+
from types import CodeType, FrameType
|
|
18
|
+
from typing import Dict, Optional, Tuple, Any
|
|
19
|
+
from os.path import basename, splitext
|
|
20
|
+
|
|
21
|
+
from _pydev_bundle import pydev_log
|
|
22
|
+
from _pydev_bundle.pydev_is_thread_alive import is_thread_alive
|
|
23
|
+
from _pydevd_bundle import pydevd_dont_trace
|
|
24
|
+
from _pydevd_bundle.pydevd_constants import (
|
|
25
|
+
GlobalDebuggerHolder,
|
|
26
|
+
ForkSafeLock,
|
|
27
|
+
PYDEVD_IPYTHON_CONTEXT,
|
|
28
|
+
EXCEPTION_TYPE_USER_UNHANDLED,
|
|
29
|
+
RETURN_VALUES_DICT,
|
|
30
|
+
PYTHON_SUSPEND,
|
|
31
|
+
)
|
|
32
|
+
from _pydevd_bundle.pydevd_frame_utils import short_tb, flag_as_unwinding, short_frame
|
|
33
|
+
from pydevd_file_utils import (
|
|
34
|
+
NORM_PATHS_AND_BASE_CONTAINER,
|
|
35
|
+
get_abs_path_real_path_and_base_from_file,
|
|
36
|
+
get_abs_path_real_path_and_base_from_frame,
|
|
37
|
+
)
|
|
38
|
+
from _pydevd_bundle.pydevd_trace_dispatch import should_stop_on_exception, handle_exception
|
|
39
|
+
from _pydevd_bundle.pydevd_constants import EXCEPTION_TYPE_HANDLED
|
|
40
|
+
from _pydevd_bundle.pydevd_trace_dispatch import is_unhandled_exception
|
|
41
|
+
from _pydevd_bundle.pydevd_breakpoints import stop_on_unhandled_exception
|
|
42
|
+
from _pydevd_bundle.pydevd_utils import get_clsname_for_code
|
|
43
|
+
|
|
44
|
+
# fmt: off
|
|
45
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
46
|
+
import cython
|
|
47
|
+
from _pydevd_bundle.pydevd_cython cimport set_additional_thread_info, any_thread_stepping, PyDBAdditionalThreadInfo
|
|
48
|
+
# ELSE
|
|
49
|
+
# from _pydevd_bundle.pydevd_additional_thread_info import set_additional_thread_info, any_thread_stepping, PyDBAdditionalThreadInfo
|
|
50
|
+
# ENDIF
|
|
51
|
+
# fmt: on
|
|
52
|
+
|
|
53
|
+
try:
|
|
54
|
+
from _pydevd_bundle.pydevd_bytecode_utils import get_smart_step_into_variant_from_frame_offset
|
|
55
|
+
except ImportError:
|
|
56
|
+
|
|
57
|
+
def get_smart_step_into_variant_from_frame_offset(*args, **kwargs):
|
|
58
|
+
return None
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
if hasattr(sys, "monitoring"):
|
|
62
|
+
DEBUGGER_ID = sys.monitoring.DEBUGGER_ID
|
|
63
|
+
monitor = sys.monitoring
|
|
64
|
+
|
|
65
|
+
_thread_local_info = threading.local()
|
|
66
|
+
_get_ident = threading.get_ident
|
|
67
|
+
_thread_active = threading._active # noqa
|
|
68
|
+
|
|
69
|
+
STATE_SUSPEND: int = 2
|
|
70
|
+
CMD_STEP_INTO: int = 107
|
|
71
|
+
CMD_STEP_OVER: int = 108
|
|
72
|
+
CMD_STEP_OVER_MY_CODE: int = 159
|
|
73
|
+
CMD_STEP_INTO_MY_CODE: int = 144
|
|
74
|
+
CMD_STEP_INTO_COROUTINE: int = 206
|
|
75
|
+
CMD_SMART_STEP_INTO: int = 128
|
|
76
|
+
can_skip: bool = True
|
|
77
|
+
CMD_STEP_RETURN: int = 109
|
|
78
|
+
CMD_STEP_OVER_MY_CODE: int = 159
|
|
79
|
+
CMD_STEP_RETURN_MY_CODE: int = 160
|
|
80
|
+
CMD_SET_BREAK: int = 111
|
|
81
|
+
CMD_SET_FUNCTION_BREAK: int = 208
|
|
82
|
+
STATE_RUN: int = 1
|
|
83
|
+
STATE_SUSPEND: int = 2
|
|
84
|
+
|
|
85
|
+
IGNORE_EXCEPTION_TAG = re.compile("[^#]*#.*@IgnoreException")
|
|
86
|
+
DEBUG_START = ("pydevd.py", "run")
|
|
87
|
+
DEBUG_START_PY3K = ("_pydev_execfile.py", "execfile")
|
|
88
|
+
TRACE_PROPERTY = "pydevd_traceproperty.py"
|
|
89
|
+
|
|
90
|
+
_global_notify_skipped_step_in = False
|
|
91
|
+
_global_notify_skipped_step_in_lock = ForkSafeLock()
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
# fmt: off
|
|
95
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
96
|
+
cdef _notify_skipped_step_in_because_of_filters(py_db, frame):
|
|
97
|
+
# ELSE
|
|
98
|
+
# def _notify_skipped_step_in_because_of_filters(py_db, frame):
|
|
99
|
+
# ENDIF
|
|
100
|
+
# fmt: on
|
|
101
|
+
global _global_notify_skipped_step_in
|
|
102
|
+
|
|
103
|
+
with _global_notify_skipped_step_in_lock:
|
|
104
|
+
if _global_notify_skipped_step_in:
|
|
105
|
+
# Check with lock in place (callers should actually have checked
|
|
106
|
+
# before without the lock in place due to performance).
|
|
107
|
+
return
|
|
108
|
+
_global_notify_skipped_step_in = True
|
|
109
|
+
py_db.notify_skipped_step_in_because_of_filters(frame)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
# Easy for cython: always get the one at level 0 as that's the caller frame
|
|
113
|
+
# (on Python we have to control the depth to get the first user frame).
|
|
114
|
+
# fmt: off
|
|
115
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
116
|
+
@cython.cfunc
|
|
117
|
+
def _getframe(depth=0):
|
|
118
|
+
return sys._getframe()
|
|
119
|
+
# ELSE
|
|
120
|
+
# _getframe = sys._getframe
|
|
121
|
+
# ENDIF
|
|
122
|
+
# fmt: on
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
# fmt: off
|
|
126
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
127
|
+
cdef _get_bootstrap_frame(depth):
|
|
128
|
+
# ELSE
|
|
129
|
+
# def _get_bootstrap_frame(depth: int) -> Tuple[Optional[FrameType], bool]:
|
|
130
|
+
# ENDIF
|
|
131
|
+
# fmt: on
|
|
132
|
+
try:
|
|
133
|
+
return _thread_local_info.f_bootstrap, _thread_local_info.is_bootstrap_frame_internal
|
|
134
|
+
except:
|
|
135
|
+
frame = _getframe(depth)
|
|
136
|
+
f_bootstrap = frame
|
|
137
|
+
# print('called at', f_bootstrap.f_code.co_name, f_bootstrap.f_code.co_filename, f_bootstrap.f_code.co_firstlineno)
|
|
138
|
+
is_bootstrap_frame_internal = False
|
|
139
|
+
while f_bootstrap is not None:
|
|
140
|
+
filename = f_bootstrap.f_code.co_filename
|
|
141
|
+
name = splitext(basename(filename))[0]
|
|
142
|
+
|
|
143
|
+
if name == "threading":
|
|
144
|
+
if f_bootstrap.f_code.co_name in ("__bootstrap", "_bootstrap"):
|
|
145
|
+
# We need __bootstrap_inner, not __bootstrap.
|
|
146
|
+
return None, False
|
|
147
|
+
|
|
148
|
+
elif f_bootstrap.f_code.co_name in ("__bootstrap_inner", "_bootstrap_inner", "is_alive"):
|
|
149
|
+
# Note: be careful not to use threading.current_thread to avoid creating a dummy thread.
|
|
150
|
+
is_bootstrap_frame_internal = True
|
|
151
|
+
break
|
|
152
|
+
|
|
153
|
+
elif name == "pydev_monkey":
|
|
154
|
+
if f_bootstrap.f_code.co_name == "__call__":
|
|
155
|
+
is_bootstrap_frame_internal = True
|
|
156
|
+
break
|
|
157
|
+
|
|
158
|
+
elif name == "pydevd":
|
|
159
|
+
if f_bootstrap.f_code.co_name in ("run", "main"):
|
|
160
|
+
# We need to get to _exec
|
|
161
|
+
return None, False
|
|
162
|
+
|
|
163
|
+
if f_bootstrap.f_code.co_name == "_exec":
|
|
164
|
+
is_bootstrap_frame_internal = True
|
|
165
|
+
break
|
|
166
|
+
|
|
167
|
+
elif f_bootstrap.f_back is None:
|
|
168
|
+
break
|
|
169
|
+
|
|
170
|
+
f_bootstrap = f_bootstrap.f_back
|
|
171
|
+
|
|
172
|
+
if f_bootstrap is not None:
|
|
173
|
+
_thread_local_info.is_bootstrap_frame_internal = is_bootstrap_frame_internal
|
|
174
|
+
_thread_local_info.f_bootstrap = f_bootstrap
|
|
175
|
+
return _thread_local_info.f_bootstrap, _thread_local_info.is_bootstrap_frame_internal
|
|
176
|
+
|
|
177
|
+
return f_bootstrap, is_bootstrap_frame_internal
|
|
178
|
+
|
|
179
|
+
# fmt: off
|
|
180
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
181
|
+
cdef _is_user_frame(frame: FrameType):
|
|
182
|
+
# ELSE
|
|
183
|
+
# def _is_user_frame(frame: FrameType) -> bool:
|
|
184
|
+
# ENDIF
|
|
185
|
+
# fmt: on
|
|
186
|
+
if frame is None:
|
|
187
|
+
return False
|
|
188
|
+
|
|
189
|
+
filename = frame.f_code.co_filename
|
|
190
|
+
name = splitext(basename(filename))[0]
|
|
191
|
+
|
|
192
|
+
# When the frame is the bootstrap it is not a user frame.
|
|
193
|
+
if name == "threading":
|
|
194
|
+
if frame.f_code.co_name in ("__bootstrap", "_bootstrap", "__bootstrap_inner", "_bootstrap_inner", "run"):
|
|
195
|
+
return False
|
|
196
|
+
|
|
197
|
+
elif name == "pydev_monkey":
|
|
198
|
+
if frame.f_code.co_name == "__call__":
|
|
199
|
+
return False
|
|
200
|
+
|
|
201
|
+
elif name == "pydevd":
|
|
202
|
+
if frame.f_code.co_name in ("_exec", "run", "main"):
|
|
203
|
+
return False
|
|
204
|
+
|
|
205
|
+
elif name == "pydevd_runpy":
|
|
206
|
+
if frame.f_code.co_name.startswith(("run", "_run")):
|
|
207
|
+
return False
|
|
208
|
+
|
|
209
|
+
elif filename == "<frozen runpy>":
|
|
210
|
+
if frame.f_code.co_name.startswith(("run", "_run")):
|
|
211
|
+
return False
|
|
212
|
+
|
|
213
|
+
elif name == 'runpy':
|
|
214
|
+
if frame.f_code.co_name.startswith(("run", "_run")):
|
|
215
|
+
return False
|
|
216
|
+
|
|
217
|
+
return True
|
|
218
|
+
|
|
219
|
+
# fmt: off
|
|
220
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
221
|
+
cdef _is_last_user_frame(frame: FrameType):
|
|
222
|
+
# ELSE
|
|
223
|
+
# def _is_last_user_frame(frame: FrameType) -> bool:
|
|
224
|
+
# ENDIF
|
|
225
|
+
# fmt: on
|
|
226
|
+
# If this frame is not a user frame, then it can't be the last one
|
|
227
|
+
if not _is_user_frame(frame):
|
|
228
|
+
return False
|
|
229
|
+
|
|
230
|
+
# If this frame is the last frame, then it is the last one
|
|
231
|
+
if frame.f_back is None:
|
|
232
|
+
return True
|
|
233
|
+
|
|
234
|
+
# If the next frame is not a user frame, then this frame is the last one
|
|
235
|
+
if not _is_user_frame(frame.f_back):
|
|
236
|
+
return True
|
|
237
|
+
|
|
238
|
+
# Otherwise if the next frame is a user frame, then this frame is not the last one
|
|
239
|
+
return False
|
|
240
|
+
|
|
241
|
+
# fmt: off
|
|
242
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
243
|
+
cdef class ThreadInfo:
|
|
244
|
+
cdef unsigned long thread_ident
|
|
245
|
+
cdef PyDBAdditionalThreadInfo additional_info
|
|
246
|
+
thread: threading.Thread
|
|
247
|
+
trace: bool
|
|
248
|
+
# ELSE
|
|
249
|
+
# class ThreadInfo:
|
|
250
|
+
# additional_info: PyDBAdditionalThreadInfo
|
|
251
|
+
# thread_ident: int
|
|
252
|
+
# thread: threading.Thread
|
|
253
|
+
# trace: bool
|
|
254
|
+
# ENDIF
|
|
255
|
+
# fmt: on
|
|
256
|
+
|
|
257
|
+
# fmt: off
|
|
258
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
259
|
+
def __init__(self, thread, unsigned long thread_ident, bint trace, PyDBAdditionalThreadInfo additional_info):
|
|
260
|
+
# ELSE
|
|
261
|
+
# def __init__(self, thread: threading.Thread, thread_ident: int, trace: bool, additional_info: PyDBAdditionalThreadInfo):
|
|
262
|
+
# ENDIF
|
|
263
|
+
# fmt: on
|
|
264
|
+
self.thread = thread
|
|
265
|
+
self.thread_ident = thread_ident
|
|
266
|
+
self.additional_info = additional_info
|
|
267
|
+
self.trace = trace
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
class _DeleteDummyThreadOnDel:
|
|
271
|
+
"""
|
|
272
|
+
Helper class to remove a dummy thread from threading._active on __del__.
|
|
273
|
+
"""
|
|
274
|
+
|
|
275
|
+
def __init__(self, dummy_thread):
|
|
276
|
+
self._dummy_thread = dummy_thread
|
|
277
|
+
self._tident = dummy_thread.ident
|
|
278
|
+
# Put the thread on a thread local variable so that when
|
|
279
|
+
# the related thread finishes this instance is collected.
|
|
280
|
+
#
|
|
281
|
+
# Note: no other references to this instance may be created.
|
|
282
|
+
# If any client code creates a reference to this instance,
|
|
283
|
+
# the related _DummyThread will be kept forever!
|
|
284
|
+
_thread_local_info._track_dummy_thread_ref = self
|
|
285
|
+
|
|
286
|
+
def __del__(self):
|
|
287
|
+
with threading._active_limbo_lock:
|
|
288
|
+
if _thread_active.get(self._tident) is self._dummy_thread:
|
|
289
|
+
_thread_active.pop(self._tident, None)
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
# fmt: off
|
|
293
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
294
|
+
cdef _create_thread_info(depth):
|
|
295
|
+
cdef unsigned long thread_ident
|
|
296
|
+
# ELSE
|
|
297
|
+
# def _create_thread_info(depth):
|
|
298
|
+
# ENDIF
|
|
299
|
+
# fmt: on
|
|
300
|
+
# Don't call threading.currentThread because if we're too early in the process
|
|
301
|
+
# we may create a dummy thread.
|
|
302
|
+
thread_ident = _get_ident()
|
|
303
|
+
|
|
304
|
+
f_bootstrap_frame, is_bootstrap_frame_internal = _get_bootstrap_frame(depth + 1)
|
|
305
|
+
if f_bootstrap_frame is None:
|
|
306
|
+
return None # Case for threading when it's still in bootstrap or early in pydevd.
|
|
307
|
+
|
|
308
|
+
if is_bootstrap_frame_internal:
|
|
309
|
+
t = None
|
|
310
|
+
if f_bootstrap_frame.f_code.co_name in ("__bootstrap_inner", "_bootstrap_inner", "is_alive"):
|
|
311
|
+
# Note: be careful not to use threading.current_thread to avoid creating a dummy thread.
|
|
312
|
+
t = f_bootstrap_frame.f_locals.get("self")
|
|
313
|
+
if not isinstance(t, threading.Thread):
|
|
314
|
+
t = None
|
|
315
|
+
|
|
316
|
+
elif f_bootstrap_frame.f_code.co_name in ("_exec", "__call__"):
|
|
317
|
+
# Note: be careful not to use threading.current_thread to avoid creating a dummy thread.
|
|
318
|
+
t = f_bootstrap_frame.f_locals.get("t")
|
|
319
|
+
if not isinstance(t, threading.Thread):
|
|
320
|
+
t = None
|
|
321
|
+
|
|
322
|
+
else:
|
|
323
|
+
# This means that the first frame is not in threading nor in pydevd.
|
|
324
|
+
# In practice this means it's some unmanaged thread, so, creating
|
|
325
|
+
# a dummy thread is ok in this use-case.
|
|
326
|
+
t = threading.current_thread()
|
|
327
|
+
|
|
328
|
+
if t is None:
|
|
329
|
+
t = _thread_active.get(thread_ident)
|
|
330
|
+
|
|
331
|
+
if isinstance(t, threading._DummyThread):
|
|
332
|
+
_thread_local_info._ref = _DeleteDummyThreadOnDel(t)
|
|
333
|
+
|
|
334
|
+
if t is None:
|
|
335
|
+
return None
|
|
336
|
+
|
|
337
|
+
if getattr(t, "is_pydev_daemon_thread", False):
|
|
338
|
+
return ThreadInfo(t, thread_ident, False, None)
|
|
339
|
+
else:
|
|
340
|
+
try:
|
|
341
|
+
additional_info = t.additional_info
|
|
342
|
+
if additional_info is None:
|
|
343
|
+
raise AttributeError()
|
|
344
|
+
except:
|
|
345
|
+
additional_info = set_additional_thread_info(t)
|
|
346
|
+
return ThreadInfo(t, thread_ident, True, additional_info)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
# fmt: off
|
|
350
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
351
|
+
cdef class FuncCodeInfo:
|
|
352
|
+
cdef str co_filename
|
|
353
|
+
cdef str canonical_normalized_filename
|
|
354
|
+
cdef str abs_path_filename
|
|
355
|
+
cdef bint always_skip_code
|
|
356
|
+
cdef bint breakpoint_found
|
|
357
|
+
cdef bint function_breakpoint_found
|
|
358
|
+
cdef bint plugin_line_breakpoint_found
|
|
359
|
+
cdef bint plugin_call_breakpoint_found
|
|
360
|
+
cdef bint plugin_line_stepping
|
|
361
|
+
cdef bint plugin_call_stepping
|
|
362
|
+
cdef bint plugin_return_stepping
|
|
363
|
+
cdef int pydb_mtime
|
|
364
|
+
cdef dict bp_line_to_breakpoint
|
|
365
|
+
cdef object function_breakpoint
|
|
366
|
+
cdef bint always_filtered_out
|
|
367
|
+
cdef bint filtered_out_force_checked
|
|
368
|
+
cdef object try_except_container_obj
|
|
369
|
+
cdef object code_obj
|
|
370
|
+
cdef str co_name
|
|
371
|
+
# ELSE
|
|
372
|
+
# class FuncCodeInfo:
|
|
373
|
+
# ENDIF
|
|
374
|
+
# fmt: on
|
|
375
|
+
def __init__(self):
|
|
376
|
+
self.co_filename: str = ""
|
|
377
|
+
self.canonical_normalized_filename: str = ""
|
|
378
|
+
self.abs_path_filename: str = ""
|
|
379
|
+
|
|
380
|
+
# These is never seen and we never stop, even if it's a callback coming
|
|
381
|
+
# from user code (these are completely invisible to the debugging tracing).
|
|
382
|
+
self.always_skip_code: bool = False
|
|
383
|
+
|
|
384
|
+
self.breakpoint_found: bool = False
|
|
385
|
+
self.function_breakpoint_found: bool = False
|
|
386
|
+
|
|
387
|
+
# A plugin can choose whether to stop on function calls or line events.
|
|
388
|
+
self.plugin_line_breakpoint_found: bool = False
|
|
389
|
+
self.plugin_call_breakpoint_found: bool = False
|
|
390
|
+
|
|
391
|
+
self.plugin_line_stepping: bool = False
|
|
392
|
+
self.plugin_call_stepping: bool = False
|
|
393
|
+
self.plugin_return_stepping: bool = False
|
|
394
|
+
|
|
395
|
+
# When pydb_mtime != PyDb.mtime the validity of breakpoints have
|
|
396
|
+
# to be re-evaluated (if invalid a new FuncCodeInfo must be created and
|
|
397
|
+
# tracing can't be disabled for the related frames).
|
|
398
|
+
self.pydb_mtime: int = -1
|
|
399
|
+
|
|
400
|
+
self.bp_line_to_breakpoint: Dict[int, Any] = {}
|
|
401
|
+
self.function_breakpoint = None
|
|
402
|
+
|
|
403
|
+
# This means some file is globally filtered out during debugging. Note
|
|
404
|
+
# that we may still need to pause in it (in a step return to user code,
|
|
405
|
+
# we may need to track this one).
|
|
406
|
+
self.always_filtered_out: bool = False
|
|
407
|
+
|
|
408
|
+
# This should be used to filter code in a CMD_STEP_INTO_MY_CODE
|
|
409
|
+
# (and other XXX_MY_CODE variants).
|
|
410
|
+
self.filtered_out_force_checked: bool = False
|
|
411
|
+
|
|
412
|
+
self.try_except_container_obj: Optional[_TryExceptContainerObj] = None
|
|
413
|
+
self.code_obj: CodeType = None
|
|
414
|
+
self.co_name: str = ""
|
|
415
|
+
|
|
416
|
+
def get_line_of_offset(self, offset):
|
|
417
|
+
for start, end, line in self.code_obj.co_lines():
|
|
418
|
+
if offset >= start and offset <= end:
|
|
419
|
+
return line
|
|
420
|
+
return -1
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
# fmt: off
|
|
424
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
425
|
+
cdef _get_thread_info(bint create, int depth):
|
|
426
|
+
# ELSE
|
|
427
|
+
# def _get_thread_info(create: bool, depth: int) -> Optional[ThreadInfo]:
|
|
428
|
+
# ENDIF
|
|
429
|
+
# fmt: on
|
|
430
|
+
"""
|
|
431
|
+
Provides thread-related info.
|
|
432
|
+
|
|
433
|
+
May return None if the thread is still not active.
|
|
434
|
+
"""
|
|
435
|
+
try:
|
|
436
|
+
# Note: changing to a `dict[thread.ident] = thread_info` had almost no
|
|
437
|
+
# effect in the performance.
|
|
438
|
+
return _thread_local_info.thread_info
|
|
439
|
+
except:
|
|
440
|
+
if not create:
|
|
441
|
+
return None
|
|
442
|
+
thread_info = _create_thread_info(depth + 1)
|
|
443
|
+
if thread_info is None:
|
|
444
|
+
return None
|
|
445
|
+
|
|
446
|
+
_thread_local_info.thread_info = thread_info
|
|
447
|
+
return _thread_local_info.thread_info
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
_CodeLineInfo = namedtuple("_CodeLineInfo", "line_to_offset, first_line, last_line")
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
# Note: this method has a version in cython too
|
|
454
|
+
# fmt: off
|
|
455
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
456
|
+
cdef _get_code_line_info(code_obj, _cache={}):
|
|
457
|
+
# ELSE
|
|
458
|
+
# def _get_code_line_info(code_obj, _cache={}):
|
|
459
|
+
# ENDIF
|
|
460
|
+
# fmt: on
|
|
461
|
+
try:
|
|
462
|
+
return _cache[code_obj]
|
|
463
|
+
except:
|
|
464
|
+
line_to_offset = {}
|
|
465
|
+
first_line = None
|
|
466
|
+
last_line = None
|
|
467
|
+
|
|
468
|
+
for offset, line in dis.findlinestarts(code_obj):
|
|
469
|
+
if offset is not None and line is not None:
|
|
470
|
+
line_to_offset[line] = offset
|
|
471
|
+
|
|
472
|
+
if len(line_to_offset):
|
|
473
|
+
first_line = min(line_to_offset)
|
|
474
|
+
last_line = max(line_to_offset)
|
|
475
|
+
ret = _CodeLineInfo(line_to_offset, first_line, last_line)
|
|
476
|
+
_cache[code_obj] = ret
|
|
477
|
+
return ret
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
_code_to_func_code_info_cache: Dict[CodeType, "FuncCodeInfo"] = {}
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
# fmt: off
|
|
484
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
485
|
+
cpdef FuncCodeInfo _get_func_code_info(code_obj, frame_or_depth):
|
|
486
|
+
cdef FuncCodeInfo func_code_info
|
|
487
|
+
# ELSE
|
|
488
|
+
# def _get_func_code_info(code_obj, frame_or_depth) -> FuncCodeInfo:
|
|
489
|
+
# ENDIF
|
|
490
|
+
# fmt: on
|
|
491
|
+
"""
|
|
492
|
+
Provides code-object related info.
|
|
493
|
+
|
|
494
|
+
Note that it contains informations on the breakpoints for a given function.
|
|
495
|
+
If breakpoints change a new FuncCodeInfo instance will be created.
|
|
496
|
+
|
|
497
|
+
Note that this can be called by any thread.
|
|
498
|
+
"""
|
|
499
|
+
py_db = GlobalDebuggerHolder.global_dbg
|
|
500
|
+
if py_db is None:
|
|
501
|
+
return None
|
|
502
|
+
|
|
503
|
+
func_code_info = _code_to_func_code_info_cache.get(code_obj)
|
|
504
|
+
if func_code_info is not None:
|
|
505
|
+
if func_code_info.pydb_mtime == py_db.mtime:
|
|
506
|
+
# if DEBUG:
|
|
507
|
+
# print('_get_func_code_info: matched mtime', key, code_obj)
|
|
508
|
+
return func_code_info
|
|
509
|
+
|
|
510
|
+
# fmt: off
|
|
511
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
512
|
+
cdef dict cache_file_type
|
|
513
|
+
cdef tuple cache_file_type_key
|
|
514
|
+
cdef PyCodeObject * code
|
|
515
|
+
cdef str co_filename
|
|
516
|
+
cdef str co_name
|
|
517
|
+
code = <PyCodeObject *> code_obj
|
|
518
|
+
co_filename = <str> code.co_filename
|
|
519
|
+
co_name = <str> code.co_name
|
|
520
|
+
# ELSE
|
|
521
|
+
# cache_file_type: dict
|
|
522
|
+
# cache_file_type_key: tuple
|
|
523
|
+
# code = code_obj
|
|
524
|
+
# co_filename: str = code.co_filename
|
|
525
|
+
# co_name: str = code.co_name
|
|
526
|
+
# ENDIF
|
|
527
|
+
# fmt: on
|
|
528
|
+
|
|
529
|
+
# print('_get_func_code_info: new (mtime did not match)', key, code_obj)
|
|
530
|
+
|
|
531
|
+
func_code_info = FuncCodeInfo()
|
|
532
|
+
func_code_info.code_obj = code_obj
|
|
533
|
+
code_line_info = _get_code_line_info(code_obj)
|
|
534
|
+
line_to_offset = code_line_info.line_to_offset
|
|
535
|
+
func_code_info.pydb_mtime = py_db.mtime
|
|
536
|
+
|
|
537
|
+
func_code_info.co_filename = co_filename
|
|
538
|
+
func_code_info.co_name = co_name
|
|
539
|
+
|
|
540
|
+
# Compute whether to always skip this.
|
|
541
|
+
try:
|
|
542
|
+
abs_path_real_path_and_base = NORM_PATHS_AND_BASE_CONTAINER[co_filename]
|
|
543
|
+
except:
|
|
544
|
+
abs_path_real_path_and_base = get_abs_path_real_path_and_base_from_file(co_filename)
|
|
545
|
+
|
|
546
|
+
func_code_info.abs_path_filename = abs_path_real_path_and_base[0]
|
|
547
|
+
func_code_info.canonical_normalized_filename = abs_path_real_path_and_base[1]
|
|
548
|
+
|
|
549
|
+
frame = None
|
|
550
|
+
cache_file_type = py_db.get_cache_file_type()
|
|
551
|
+
# Note: this cache key must be the same from PyDB.get_file_type() -- see it for comments
|
|
552
|
+
# on the cache.
|
|
553
|
+
cache_file_type_key = (code.co_firstlineno, abs_path_real_path_and_base[0], code_obj)
|
|
554
|
+
try:
|
|
555
|
+
file_type = cache_file_type[cache_file_type_key] # Make it faster
|
|
556
|
+
except:
|
|
557
|
+
if frame is None:
|
|
558
|
+
if frame_or_depth.__class__ == int:
|
|
559
|
+
frame = _getframe(frame_or_depth + 1)
|
|
560
|
+
else:
|
|
561
|
+
frame = frame_or_depth
|
|
562
|
+
assert frame.f_code is code_obj, "%s != %s" % (frame.f_code, code_obj)
|
|
563
|
+
|
|
564
|
+
file_type = py_db.get_file_type(frame, abs_path_real_path_and_base) # we don't want to debug anything related to pydevd
|
|
565
|
+
|
|
566
|
+
if file_type is not None:
|
|
567
|
+
func_code_info.always_skip_code = True
|
|
568
|
+
func_code_info.always_filtered_out = True
|
|
569
|
+
_code_to_func_code_info_cache[code_obj] = func_code_info
|
|
570
|
+
return func_code_info
|
|
571
|
+
|
|
572
|
+
# still not set, check for dont trace comments.
|
|
573
|
+
if pydevd_dont_trace.should_trace_hook is not None:
|
|
574
|
+
# I.e.: cache the result skip (no need to evaluate the same frame multiple times).
|
|
575
|
+
# Note that on a code reload, we won't re-evaluate this because in practice, the frame.f_code
|
|
576
|
+
# Which will be handled by this frame is read-only, so, we can cache it safely.
|
|
577
|
+
if not pydevd_dont_trace.should_trace_hook(code_obj, func_code_info.abs_path_filename):
|
|
578
|
+
if frame is None:
|
|
579
|
+
if frame_or_depth.__class__ == int:
|
|
580
|
+
frame = _getframe(frame_or_depth + 1)
|
|
581
|
+
else:
|
|
582
|
+
frame = frame_or_depth
|
|
583
|
+
assert frame.f_code is code_obj
|
|
584
|
+
|
|
585
|
+
func_code_info.always_filtered_out = True
|
|
586
|
+
_code_to_func_code_info_cache[code_obj] = func_code_info
|
|
587
|
+
return func_code_info
|
|
588
|
+
|
|
589
|
+
if frame is None:
|
|
590
|
+
if frame_or_depth.__class__ == int:
|
|
591
|
+
frame = _getframe(frame_or_depth + 1)
|
|
592
|
+
else:
|
|
593
|
+
frame = frame_or_depth
|
|
594
|
+
assert frame.f_code is code_obj
|
|
595
|
+
|
|
596
|
+
func_code_info.filtered_out_force_checked = py_db.apply_files_filter(frame, func_code_info.abs_path_filename, True)
|
|
597
|
+
|
|
598
|
+
if py_db.is_files_filter_enabled:
|
|
599
|
+
func_code_info.always_filtered_out = func_code_info.filtered_out_force_checked
|
|
600
|
+
if func_code_info.always_filtered_out:
|
|
601
|
+
_code_to_func_code_info_cache[code_obj] = func_code_info
|
|
602
|
+
return func_code_info
|
|
603
|
+
|
|
604
|
+
else:
|
|
605
|
+
func_code_info.always_filtered_out = False
|
|
606
|
+
|
|
607
|
+
# Handle regular breakpoints
|
|
608
|
+
breakpoints: dict = py_db.breakpoints.get(func_code_info.canonical_normalized_filename)
|
|
609
|
+
function_breakpoint: object = py_db.function_breakpoint_name_to_breakpoint.get(func_code_info.co_name)
|
|
610
|
+
# print('\n---')
|
|
611
|
+
# print(py_db.breakpoints)
|
|
612
|
+
# print(func_code_info.canonical_normalized_filename)
|
|
613
|
+
# print(py_db.breakpoints.get(func_code_info.canonical_normalized_filename))
|
|
614
|
+
if function_breakpoint:
|
|
615
|
+
# Go directly into tracing mode
|
|
616
|
+
func_code_info.function_breakpoint_found = True
|
|
617
|
+
func_code_info.function_breakpoint = function_breakpoint
|
|
618
|
+
|
|
619
|
+
if breakpoints:
|
|
620
|
+
# if DEBUG:
|
|
621
|
+
# print('found breakpoints', code_obj_py.co_name, breakpoints)
|
|
622
|
+
|
|
623
|
+
bp_line_to_breakpoint = {}
|
|
624
|
+
|
|
625
|
+
for breakpoint_line, bp in breakpoints.items():
|
|
626
|
+
if breakpoint_line in line_to_offset:
|
|
627
|
+
bp_line_to_breakpoint[breakpoint_line] = bp
|
|
628
|
+
|
|
629
|
+
func_code_info.breakpoint_found = bool(bp_line_to_breakpoint)
|
|
630
|
+
func_code_info.bp_line_to_breakpoint = bp_line_to_breakpoint
|
|
631
|
+
|
|
632
|
+
if py_db.plugin:
|
|
633
|
+
plugin_manager = py_db.plugin
|
|
634
|
+
is_tracked_frame = plugin_manager.is_tracked_frame(frame)
|
|
635
|
+
|
|
636
|
+
if is_tracked_frame:
|
|
637
|
+
if py_db.has_plugin_line_breaks:
|
|
638
|
+
required_events_breakpoint = plugin_manager.required_events_breakpoint()
|
|
639
|
+
func_code_info.plugin_line_breakpoint_found = "line" in required_events_breakpoint
|
|
640
|
+
func_code_info.plugin_call_breakpoint_found = "call" in required_events_breakpoint
|
|
641
|
+
|
|
642
|
+
required_events_stepping = plugin_manager.required_events_stepping()
|
|
643
|
+
func_code_info.plugin_line_stepping: bool = "line" in required_events_stepping
|
|
644
|
+
func_code_info.plugin_call_stepping: bool = "call" in required_events_stepping
|
|
645
|
+
func_code_info.plugin_return_stepping: bool = "return" in required_events_stepping
|
|
646
|
+
|
|
647
|
+
_code_to_func_code_info_cache[code_obj] = func_code_info
|
|
648
|
+
return func_code_info
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
# fmt: off
|
|
652
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
653
|
+
cdef _enable_line_tracing(code):
|
|
654
|
+
# ELSE
|
|
655
|
+
# def _enable_line_tracing(code):
|
|
656
|
+
# ENDIF
|
|
657
|
+
# fmt: on
|
|
658
|
+
# print('enable line tracing', code)
|
|
659
|
+
_ensure_monitoring()
|
|
660
|
+
events = monitor.get_local_events(DEBUGGER_ID, code)
|
|
661
|
+
monitor.set_local_events(DEBUGGER_ID, code, events | monitor.events.LINE | monitor.events.JUMP)
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
# fmt: off
|
|
665
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
666
|
+
cdef _enable_return_tracing(code):
|
|
667
|
+
# ELSE
|
|
668
|
+
# def _enable_return_tracing(code):
|
|
669
|
+
# ENDIF
|
|
670
|
+
# fmt: on
|
|
671
|
+
# print('enable return tracing', code)
|
|
672
|
+
_ensure_monitoring()
|
|
673
|
+
events = monitor.get_local_events(DEBUGGER_ID, code)
|
|
674
|
+
monitor.set_local_events(DEBUGGER_ID, code, events | monitor.events.PY_RETURN)
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
# fmt: off
|
|
678
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
679
|
+
cpdef disable_code_tracing(code):
|
|
680
|
+
# ELSE
|
|
681
|
+
# def disable_code_tracing(code):
|
|
682
|
+
# ENDIF
|
|
683
|
+
# fmt: on
|
|
684
|
+
_ensure_monitoring()
|
|
685
|
+
monitor.set_local_events(DEBUGGER_ID, code, 0)
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
# fmt: off
|
|
689
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
690
|
+
cpdef enable_code_tracing(unsigned long thread_ident, code, frame):
|
|
691
|
+
# ELSE
|
|
692
|
+
# def enable_code_tracing(thread_ident: Optional[int], code, frame) -> bool:
|
|
693
|
+
# ENDIF
|
|
694
|
+
# fmt: on
|
|
695
|
+
"""
|
|
696
|
+
Note: this must enable code tracing for the given code/frame.
|
|
697
|
+
|
|
698
|
+
The frame can be from any thread!
|
|
699
|
+
|
|
700
|
+
:return: Whether code tracing was added in this function to the given code.
|
|
701
|
+
"""
|
|
702
|
+
# DEBUG = False # 'my_code.py' in code.co_filename or 'other.py' in code.co_filename
|
|
703
|
+
# if DEBUG:
|
|
704
|
+
# print('==== enable code tracing', code.co_filename[-30:], code.co_name)
|
|
705
|
+
py_db: object = GlobalDebuggerHolder.global_dbg
|
|
706
|
+
if py_db is None or py_db.pydb_disposed:
|
|
707
|
+
return False
|
|
708
|
+
|
|
709
|
+
func_code_info: FuncCodeInfo = _get_func_code_info(code, frame)
|
|
710
|
+
if func_code_info.always_skip_code:
|
|
711
|
+
# if DEBUG:
|
|
712
|
+
# print('disable (always skip)')
|
|
713
|
+
return False
|
|
714
|
+
|
|
715
|
+
try:
|
|
716
|
+
thread = threading._active.get(thread_ident)
|
|
717
|
+
if thread is None:
|
|
718
|
+
return False
|
|
719
|
+
additional_info = set_additional_thread_info(thread)
|
|
720
|
+
except:
|
|
721
|
+
# Cannot set based on stepping
|
|
722
|
+
return False
|
|
723
|
+
|
|
724
|
+
return _enable_code_tracing(py_db, additional_info, func_code_info, code, frame, False)
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
# fmt: off
|
|
728
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
729
|
+
cdef bint _enable_code_tracing(py_db, PyDBAdditionalThreadInfo additional_info, FuncCodeInfo func_code_info, code, frame, bint warn_on_filtered_out):
|
|
730
|
+
cdef int step_cmd
|
|
731
|
+
cdef bint is_stepping
|
|
732
|
+
cdef bint code_tracing_added
|
|
733
|
+
# ELSE
|
|
734
|
+
# def _enable_code_tracing(py_db, additional_info, func_code_info: FuncCodeInfo, code, frame, warn_on_filtered_out) -> bool:
|
|
735
|
+
# ENDIF
|
|
736
|
+
# fmt: on
|
|
737
|
+
"""
|
|
738
|
+
:return: Whether code tracing was added in this function to the given code.
|
|
739
|
+
"""
|
|
740
|
+
# DEBUG = False # 'my_code.py' in code.co_filename or 'other.py' in code.co_filename
|
|
741
|
+
step_cmd = additional_info.pydev_step_cmd
|
|
742
|
+
is_stepping = step_cmd != -1
|
|
743
|
+
code_tracing_added = False
|
|
744
|
+
|
|
745
|
+
if func_code_info.always_filtered_out:
|
|
746
|
+
# if DEBUG:
|
|
747
|
+
# print('disable (always filtered out)')
|
|
748
|
+
if (
|
|
749
|
+
warn_on_filtered_out
|
|
750
|
+
and is_stepping
|
|
751
|
+
and additional_info.pydev_original_step_cmd in (CMD_STEP_INTO, CMD_STEP_INTO_MY_CODE)
|
|
752
|
+
and not _global_notify_skipped_step_in
|
|
753
|
+
):
|
|
754
|
+
_notify_skipped_step_in_because_of_filters(py_db, frame)
|
|
755
|
+
|
|
756
|
+
if is_stepping:
|
|
757
|
+
# Tracing may be needed for return value
|
|
758
|
+
_enable_step_tracing(py_db, code, step_cmd, additional_info, frame)
|
|
759
|
+
code_tracing_added = True
|
|
760
|
+
return code_tracing_added
|
|
761
|
+
|
|
762
|
+
if func_code_info.breakpoint_found or func_code_info.plugin_line_breakpoint_found:
|
|
763
|
+
_enable_line_tracing(code)
|
|
764
|
+
code_tracing_added = True
|
|
765
|
+
|
|
766
|
+
if is_stepping:
|
|
767
|
+
_enable_step_tracing(py_db, code, step_cmd, additional_info, frame)
|
|
768
|
+
code_tracing_added = True
|
|
769
|
+
|
|
770
|
+
return code_tracing_added
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
# fmt: off
|
|
774
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
775
|
+
cdef _enable_step_tracing(py_db, code, step_cmd, PyDBAdditionalThreadInfo info, frame):
|
|
776
|
+
# ELSE
|
|
777
|
+
# def _enable_step_tracing(py_db, code, step_cmd, info, frame):
|
|
778
|
+
# ENDIF
|
|
779
|
+
# fmt: on
|
|
780
|
+
if step_cmd in (CMD_STEP_INTO, CMD_STEP_INTO_MY_CODE, CMD_STEP_INTO_COROUTINE, CMD_SMART_STEP_INTO):
|
|
781
|
+
# Stepping (must have line/return tracing enabled).
|
|
782
|
+
_enable_line_tracing(code)
|
|
783
|
+
_enable_return_tracing(code)
|
|
784
|
+
|
|
785
|
+
elif step_cmd in (CMD_STEP_RETURN, CMD_STEP_RETURN_MY_CODE) and _is_same_frame(info, info.pydev_step_stop, frame):
|
|
786
|
+
_enable_return_tracing(code)
|
|
787
|
+
|
|
788
|
+
elif step_cmd in (CMD_STEP_OVER, CMD_STEP_OVER_MY_CODE):
|
|
789
|
+
if _is_same_frame(info, info.pydev_step_stop, frame):
|
|
790
|
+
_enable_line_tracing(code)
|
|
791
|
+
|
|
792
|
+
# Wee need to enable return tracing because if we have a return during a step over
|
|
793
|
+
# we need to stop too.
|
|
794
|
+
_enable_return_tracing(code)
|
|
795
|
+
elif py_db.show_return_values and _is_same_frame(info, info.pydev_step_stop, frame.f_back):
|
|
796
|
+
# Show return values on step over.
|
|
797
|
+
_enable_return_tracing(code)
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
# fmt: off
|
|
801
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
802
|
+
cdef class _TryExceptContainerObj:
|
|
803
|
+
cdef list try_except_infos
|
|
804
|
+
# ELSE
|
|
805
|
+
# class _TryExceptContainerObj:
|
|
806
|
+
# ENDIF
|
|
807
|
+
# fmt: on
|
|
808
|
+
"""
|
|
809
|
+
A dumb container object just to contain the try..except info when needed. Meant to be
|
|
810
|
+
persistent among multiple PyDBFrames to the same code object.
|
|
811
|
+
"""
|
|
812
|
+
|
|
813
|
+
# fmt: off
|
|
814
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
815
|
+
def __init__(self, list try_except_infos):
|
|
816
|
+
self.try_except_infos = try_except_infos
|
|
817
|
+
# ELSE
|
|
818
|
+
# def __init__(self, try_except_infos):
|
|
819
|
+
# self.try_except_infos = try_except_infos
|
|
820
|
+
#
|
|
821
|
+
# ENDIF
|
|
822
|
+
# fmt: on
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
# fmt: off
|
|
826
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
827
|
+
cdef _unwind_event(code, instruction, exc):
|
|
828
|
+
cdef ThreadInfo thread_info
|
|
829
|
+
cdef FuncCodeInfo func_code_info
|
|
830
|
+
# ELSE
|
|
831
|
+
# def _unwind_event(code, instruction, exc):
|
|
832
|
+
# ENDIF
|
|
833
|
+
# fmt: on
|
|
834
|
+
try:
|
|
835
|
+
thread_info = _thread_local_info.thread_info
|
|
836
|
+
except:
|
|
837
|
+
thread_info = _get_thread_info(True, 1)
|
|
838
|
+
if thread_info is None:
|
|
839
|
+
return
|
|
840
|
+
|
|
841
|
+
frame = _getframe(1)
|
|
842
|
+
arg = (type(exc), exc, exc.__traceback__)
|
|
843
|
+
|
|
844
|
+
py_db: object = GlobalDebuggerHolder.global_dbg
|
|
845
|
+
if py_db is None or py_db.pydb_disposed:
|
|
846
|
+
return
|
|
847
|
+
|
|
848
|
+
if not thread_info.trace or not is_thread_alive(thread_info.thread):
|
|
849
|
+
# For thread-related stuff we can't disable the code tracing because other
|
|
850
|
+
# threads may still want it...
|
|
851
|
+
return
|
|
852
|
+
|
|
853
|
+
func_code_info: FuncCodeInfo = _get_func_code_info(code, 1)
|
|
854
|
+
if func_code_info.always_skip_code:
|
|
855
|
+
return
|
|
856
|
+
|
|
857
|
+
# print('_unwind_event', code, exc)
|
|
858
|
+
|
|
859
|
+
has_caught_exception_breakpoint_in_pydb = (
|
|
860
|
+
py_db.break_on_caught_exceptions or py_db.break_on_user_uncaught_exceptions or py_db.has_plugin_exception_breaks
|
|
861
|
+
)
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
if has_caught_exception_breakpoint_in_pydb:
|
|
865
|
+
_should_stop, frame, user_uncaught_exc_info = should_stop_on_exception(
|
|
866
|
+
py_db, thread_info.additional_info, frame, thread_info.thread, arg, None
|
|
867
|
+
)
|
|
868
|
+
if user_uncaught_exc_info:
|
|
869
|
+
# TODO: Check: this may no longer be needed as in the unwind we know it's
|
|
870
|
+
# an exception bubbling up (wait for all tests to pass to check it).
|
|
871
|
+
if func_code_info.try_except_container_obj is None:
|
|
872
|
+
container_obj = _TryExceptContainerObj(py_db.collect_try_except_info(frame.f_code))
|
|
873
|
+
func_code_info.try_except_container_obj = container_obj
|
|
874
|
+
|
|
875
|
+
is_unhandled = is_unhandled_exception(
|
|
876
|
+
func_code_info.try_except_container_obj, py_db, frame, user_uncaught_exc_info[1], user_uncaught_exc_info[2]
|
|
877
|
+
)
|
|
878
|
+
|
|
879
|
+
if is_unhandled:
|
|
880
|
+
# print('stop in user uncaught')
|
|
881
|
+
handle_exception(py_db, thread_info.thread, frame, user_uncaught_exc_info[0], EXCEPTION_TYPE_USER_UNHANDLED)
|
|
882
|
+
return
|
|
883
|
+
|
|
884
|
+
break_on_uncaught_exceptions = py_db.break_on_uncaught_exceptions
|
|
885
|
+
if break_on_uncaught_exceptions and _is_last_user_frame(frame):
|
|
886
|
+
stop_on_unhandled_exception(py_db, thread_info.thread, thread_info.additional_info, arg)
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
# fmt: off
|
|
890
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
891
|
+
cdef _raise_event(code, instruction, exc):
|
|
892
|
+
cdef ThreadInfo thread_info
|
|
893
|
+
cdef FuncCodeInfo func_code_info
|
|
894
|
+
# ELSE
|
|
895
|
+
# def _raise_event(code, instruction, exc):
|
|
896
|
+
# ENDIF
|
|
897
|
+
# fmt: on
|
|
898
|
+
"""
|
|
899
|
+
The way this should work is the following: when the user is using
|
|
900
|
+
pydevd to do the launch and we're on a managed stack, we should consider
|
|
901
|
+
unhandled only if it gets into a pydevd. If it's a thread, if it stops
|
|
902
|
+
inside the threading and if it's an unmanaged thread (i.e.: QThread)
|
|
903
|
+
then stop if it doesn't have a back frame.
|
|
904
|
+
|
|
905
|
+
Note: unlike other events, this one is global and not per-code (so,
|
|
906
|
+
it cannot be individually enabled/disabled for a given code object).
|
|
907
|
+
"""
|
|
908
|
+
try:
|
|
909
|
+
thread_info = _thread_local_info.thread_info
|
|
910
|
+
except:
|
|
911
|
+
thread_info = _get_thread_info(True, 1)
|
|
912
|
+
if thread_info is None:
|
|
913
|
+
return
|
|
914
|
+
|
|
915
|
+
frame = _getframe(1)
|
|
916
|
+
arg = (type(exc), exc, exc.__traceback__)
|
|
917
|
+
|
|
918
|
+
py_db: object = GlobalDebuggerHolder.global_dbg
|
|
919
|
+
if py_db is None or py_db.pydb_disposed:
|
|
920
|
+
return
|
|
921
|
+
|
|
922
|
+
if not thread_info.trace or not is_thread_alive(thread_info.thread):
|
|
923
|
+
# For thread-related stuff we can't disable the code tracing because other
|
|
924
|
+
# threads may still want it...
|
|
925
|
+
return
|
|
926
|
+
|
|
927
|
+
func_code_info: FuncCodeInfo = _get_func_code_info(code, 1)
|
|
928
|
+
if func_code_info.always_skip_code:
|
|
929
|
+
return
|
|
930
|
+
|
|
931
|
+
# print('_raise_event --- ', code, exc)
|
|
932
|
+
|
|
933
|
+
# Compute the previous exception info (if any). We use it to check if the exception
|
|
934
|
+
# should be stopped
|
|
935
|
+
prev_exc_info = _thread_local_info._user_uncaught_exc_info if hasattr(_thread_local_info, "_user_uncaught_exc_info") else None
|
|
936
|
+
should_stop, frame, _user_uncaught_exc_info = should_stop_on_exception(
|
|
937
|
+
py_db, thread_info.additional_info, frame, thread_info.thread, arg, prev_exc_info
|
|
938
|
+
)
|
|
939
|
+
|
|
940
|
+
# Save the current exception info for the next raise event.
|
|
941
|
+
_thread_local_info._user_uncaught_exc_info = _user_uncaught_exc_info
|
|
942
|
+
|
|
943
|
+
# print('!!!! should_stop (in raise)', should_stop)
|
|
944
|
+
if should_stop:
|
|
945
|
+
handle_exception(py_db, thread_info.thread, frame, arg, EXCEPTION_TYPE_HANDLED)
|
|
946
|
+
|
|
947
|
+
# Once we leave the raise event, we are no longer in the state of 'just_raised', so
|
|
948
|
+
# indicate that this traceback is for an exception in the unwinding state
|
|
949
|
+
flag_as_unwinding(exc.__traceback__)
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
# fmt: off
|
|
953
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
954
|
+
cdef str get_func_name(frame):
|
|
955
|
+
cdef str func_name
|
|
956
|
+
# ELSE
|
|
957
|
+
# def get_func_name(frame):
|
|
958
|
+
# ENDIF
|
|
959
|
+
# fmt: on
|
|
960
|
+
code_obj = frame.f_code
|
|
961
|
+
func_name = code_obj.co_name
|
|
962
|
+
try:
|
|
963
|
+
cls_name = get_clsname_for_code(code_obj, frame)
|
|
964
|
+
if cls_name is not None:
|
|
965
|
+
return "%s.%s" % (cls_name, func_name)
|
|
966
|
+
else:
|
|
967
|
+
return func_name
|
|
968
|
+
except:
|
|
969
|
+
pydev_log.exception()
|
|
970
|
+
return func_name
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
# fmt: off
|
|
974
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
975
|
+
cdef _show_return_values(frame, arg):
|
|
976
|
+
# ELSE
|
|
977
|
+
# def _show_return_values(frame, arg):
|
|
978
|
+
# ENDIF
|
|
979
|
+
# fmt: on
|
|
980
|
+
try:
|
|
981
|
+
try:
|
|
982
|
+
f_locals_back = getattr(frame.f_back, "f_locals", None)
|
|
983
|
+
if f_locals_back is not None:
|
|
984
|
+
return_values_dict = f_locals_back.get(RETURN_VALUES_DICT, None)
|
|
985
|
+
if return_values_dict is None:
|
|
986
|
+
return_values_dict = {}
|
|
987
|
+
f_locals_back[RETURN_VALUES_DICT] = return_values_dict
|
|
988
|
+
name = get_func_name(frame)
|
|
989
|
+
return_values_dict[name] = arg
|
|
990
|
+
except:
|
|
991
|
+
pydev_log.exception()
|
|
992
|
+
finally:
|
|
993
|
+
f_locals_back = None
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
# fmt: off
|
|
997
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
998
|
+
cdef _remove_return_values(py_db, frame):
|
|
999
|
+
# ELSE
|
|
1000
|
+
# def _remove_return_values(py_db, frame):
|
|
1001
|
+
# ENDIF
|
|
1002
|
+
# fmt: on
|
|
1003
|
+
try:
|
|
1004
|
+
try:
|
|
1005
|
+
# Showing return values was turned off, we should remove them from locals dict.
|
|
1006
|
+
# The values can be in the current frame or in the back one
|
|
1007
|
+
frame.f_locals.pop(RETURN_VALUES_DICT, None)
|
|
1008
|
+
|
|
1009
|
+
f_locals_back = getattr(frame.f_back, "f_locals", None)
|
|
1010
|
+
if f_locals_back is not None:
|
|
1011
|
+
f_locals_back.pop(RETURN_VALUES_DICT, None)
|
|
1012
|
+
except:
|
|
1013
|
+
pydev_log.exception()
|
|
1014
|
+
finally:
|
|
1015
|
+
f_locals_back = None
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
# fmt: off
|
|
1019
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
1020
|
+
cdef _return_event(code, instruction, retval):
|
|
1021
|
+
cdef ThreadInfo thread_info
|
|
1022
|
+
cdef FuncCodeInfo func_code_info
|
|
1023
|
+
cdef PyDBAdditionalThreadInfo info
|
|
1024
|
+
cdef int step_cmd
|
|
1025
|
+
# ELSE
|
|
1026
|
+
# def _return_event(code, instruction, retval):
|
|
1027
|
+
# ENDIF
|
|
1028
|
+
# fmt: on
|
|
1029
|
+
try:
|
|
1030
|
+
thread_info = _thread_local_info.thread_info
|
|
1031
|
+
except:
|
|
1032
|
+
thread_info = _get_thread_info(True, 1)
|
|
1033
|
+
if thread_info is None:
|
|
1034
|
+
return
|
|
1035
|
+
|
|
1036
|
+
py_db: object = GlobalDebuggerHolder.global_dbg
|
|
1037
|
+
if py_db is None or py_db.pydb_disposed:
|
|
1038
|
+
return monitor.DISABLE
|
|
1039
|
+
|
|
1040
|
+
if not thread_info.trace or not is_thread_alive(thread_info.thread):
|
|
1041
|
+
# For thread-related stuff we can't disable the code tracing because other
|
|
1042
|
+
# threads may still want it...
|
|
1043
|
+
return
|
|
1044
|
+
|
|
1045
|
+
func_code_info: FuncCodeInfo = _get_func_code_info(code, 1)
|
|
1046
|
+
if func_code_info.always_skip_code:
|
|
1047
|
+
return monitor.DISABLE
|
|
1048
|
+
|
|
1049
|
+
info = thread_info.additional_info
|
|
1050
|
+
|
|
1051
|
+
# We know the frame depth.
|
|
1052
|
+
frame = _getframe(1)
|
|
1053
|
+
|
|
1054
|
+
step_cmd = info.pydev_step_cmd
|
|
1055
|
+
if step_cmd == -1:
|
|
1056
|
+
return
|
|
1057
|
+
|
|
1058
|
+
if info.suspend_type != PYTHON_SUSPEND:
|
|
1059
|
+
# Plugin stepping
|
|
1060
|
+
if func_code_info.plugin_return_stepping:
|
|
1061
|
+
_plugin_stepping(py_db, step_cmd, "return", frame, thread_info)
|
|
1062
|
+
return
|
|
1063
|
+
|
|
1064
|
+
# Python line stepping
|
|
1065
|
+
stop_frame = info.pydev_step_stop
|
|
1066
|
+
if step_cmd in (CMD_STEP_INTO, CMD_STEP_INTO_MY_CODE, CMD_STEP_INTO_COROUTINE):
|
|
1067
|
+
force_check_project_scope = step_cmd == CMD_STEP_INTO_MY_CODE
|
|
1068
|
+
if frame.f_back is not None and not info.pydev_use_scoped_step_frame:
|
|
1069
|
+
back_func_code_info = _get_func_code_info(frame.f_back.f_code, frame.f_back)
|
|
1070
|
+
if (
|
|
1071
|
+
# Not filtered out.
|
|
1072
|
+
not back_func_code_info.always_skip_code
|
|
1073
|
+
and not back_func_code_info.always_filtered_out
|
|
1074
|
+
and not (force_check_project_scope and back_func_code_info.filtered_out_force_checked)
|
|
1075
|
+
# Prevent stopping in a return to the same location we were initially
|
|
1076
|
+
# (i.e.: double-stop at the same place due to some filtering).
|
|
1077
|
+
and info.step_in_initial_location != (frame.f_back, frame.f_back.f_lineno)
|
|
1078
|
+
):
|
|
1079
|
+
if py_db.show_return_values:
|
|
1080
|
+
_show_return_values(frame, retval)
|
|
1081
|
+
|
|
1082
|
+
_stop_on_return(py_db, thread_info, info, step_cmd, frame, retval)
|
|
1083
|
+
return
|
|
1084
|
+
|
|
1085
|
+
if step_cmd in (CMD_STEP_RETURN, CMD_STEP_RETURN_MY_CODE) and _is_same_frame(info, stop_frame, frame):
|
|
1086
|
+
if py_db.show_return_values:
|
|
1087
|
+
_show_return_values(frame, retval)
|
|
1088
|
+
|
|
1089
|
+
_stop_on_return(py_db, thread_info, info, step_cmd, frame, retval)
|
|
1090
|
+
return
|
|
1091
|
+
|
|
1092
|
+
elif (
|
|
1093
|
+
step_cmd in (CMD_STEP_OVER, CMD_STEP_OVER_MY_CODE)
|
|
1094
|
+
and not info.pydev_use_scoped_step_frame
|
|
1095
|
+
and _is_same_frame(info, stop_frame, frame)
|
|
1096
|
+
):
|
|
1097
|
+
# This isn't in the sys.settrace version: on a step over, if we return and the return is valid, show
|
|
1098
|
+
# as a step return instead of going back to step into mode (but if the back frame is not valid, then
|
|
1099
|
+
# go to step into mode).
|
|
1100
|
+
f_back = frame.f_back
|
|
1101
|
+
if f_back is not None:
|
|
1102
|
+
back_func_code_info = _get_func_code_info(f_back.f_code, 2)
|
|
1103
|
+
force_check_project_scope = step_cmd == CMD_STEP_OVER_MY_CODE
|
|
1104
|
+
|
|
1105
|
+
if (
|
|
1106
|
+
back_func_code_info is not None
|
|
1107
|
+
and not back_func_code_info.always_skip_code
|
|
1108
|
+
and not back_func_code_info.always_filtered_out
|
|
1109
|
+
and not (force_check_project_scope and back_func_code_info.filtered_out_force_checked)
|
|
1110
|
+
):
|
|
1111
|
+
if py_db.show_return_values:
|
|
1112
|
+
_show_return_values(frame, retval)
|
|
1113
|
+
|
|
1114
|
+
_stop_on_return(py_db, thread_info, info, step_cmd, frame, retval)
|
|
1115
|
+
return
|
|
1116
|
+
|
|
1117
|
+
elif step_cmd == CMD_SMART_STEP_INTO:
|
|
1118
|
+
if _is_same_frame(info, stop_frame, frame):
|
|
1119
|
+
# We're exiting the smart step into initial frame (so, we probably didn't find our target).
|
|
1120
|
+
if py_db.show_return_values:
|
|
1121
|
+
_show_return_values(frame, retval)
|
|
1122
|
+
|
|
1123
|
+
_stop_on_return(py_db, thread_info, info, step_cmd, frame, retval)
|
|
1124
|
+
return
|
|
1125
|
+
|
|
1126
|
+
if py_db.show_return_values:
|
|
1127
|
+
if (
|
|
1128
|
+
(
|
|
1129
|
+
info.pydev_step_cmd in (CMD_STEP_OVER, CMD_STEP_OVER_MY_CODE, CMD_SMART_STEP_INTO)
|
|
1130
|
+
and (_is_same_frame(info, stop_frame, frame.f_back))
|
|
1131
|
+
)
|
|
1132
|
+
or (info.pydev_step_cmd in (CMD_STEP_RETURN, CMD_STEP_RETURN_MY_CODE) and (info, _is_same_frame(info, stop_frame, frame)))
|
|
1133
|
+
or (info.pydev_step_cmd in (CMD_STEP_INTO, CMD_STEP_INTO_COROUTINE))
|
|
1134
|
+
or (
|
|
1135
|
+
info.pydev_step_cmd == CMD_STEP_INTO_MY_CODE
|
|
1136
|
+
and frame.f_back is not None
|
|
1137
|
+
and not py_db.apply_files_filter(frame.f_back, frame.f_back.f_code.co_filename, True)
|
|
1138
|
+
)
|
|
1139
|
+
):
|
|
1140
|
+
_show_return_values(frame, retval)
|
|
1141
|
+
|
|
1142
|
+
if step_cmd in (CMD_STEP_OVER, CMD_STEP_RETURN, CMD_STEP_OVER_MY_CODE, CMD_STEP_RETURN_MY_CODE, CMD_SMART_STEP_INTO):
|
|
1143
|
+
# If we are in single step mode and something causes us to exit the current frame, we need to make sure we break
|
|
1144
|
+
# eventually. Force the step mode to step into and the step stop frame to None.
|
|
1145
|
+
# I.e.: F6 in the end of a function should stop in the next possible position (instead of forcing the user
|
|
1146
|
+
# to make a step in or step over at that location).
|
|
1147
|
+
# Note: this is especially troublesome when we're skipping code with the
|
|
1148
|
+
# @DontTrace comment.
|
|
1149
|
+
stop_frame = info.pydev_step_stop
|
|
1150
|
+
if stop_frame is frame and not info.pydev_use_scoped_step_frame:
|
|
1151
|
+
if step_cmd in (CMD_STEP_OVER, CMD_STEP_RETURN, CMD_SMART_STEP_INTO):
|
|
1152
|
+
info.pydev_step_cmd = CMD_STEP_INTO
|
|
1153
|
+
else:
|
|
1154
|
+
info.pydev_step_cmd = CMD_STEP_INTO_MY_CODE
|
|
1155
|
+
info.pydev_step_stop = None
|
|
1156
|
+
_enable_code_tracing_for_frame_and_parents(thread_info, stop_frame.f_back)
|
|
1157
|
+
if py_db.show_return_values:
|
|
1158
|
+
_show_return_values(frame, retval)
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
# fmt: off
|
|
1162
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
1163
|
+
cdef _enable_code_tracing_for_frame_and_parents(ThreadInfo thread_info, frame):
|
|
1164
|
+
cdef FuncCodeInfo func_code_info
|
|
1165
|
+
# ELSE
|
|
1166
|
+
# def _enable_code_tracing_for_frame_and_parents(thread_info, frame):
|
|
1167
|
+
# ENDIF
|
|
1168
|
+
# fmt: on
|
|
1169
|
+
py_db: object = GlobalDebuggerHolder.global_dbg
|
|
1170
|
+
if py_db is None or py_db.pydb_disposed:
|
|
1171
|
+
return
|
|
1172
|
+
|
|
1173
|
+
while frame is not None:
|
|
1174
|
+
func_code_info: FuncCodeInfo = _get_func_code_info(frame.f_code, frame)
|
|
1175
|
+
if func_code_info.always_skip_code:
|
|
1176
|
+
frame = frame.f_back
|
|
1177
|
+
continue
|
|
1178
|
+
|
|
1179
|
+
_enable_code_tracing(py_db, thread_info.additional_info, func_code_info, frame.f_code, frame, False)
|
|
1180
|
+
frame = frame.f_back
|
|
1181
|
+
|
|
1182
|
+
|
|
1183
|
+
# fmt: off
|
|
1184
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
1185
|
+
cdef _stop_on_return(py_db, ThreadInfo thread_info, PyDBAdditionalThreadInfo info, int step_cmd, frame, retval):
|
|
1186
|
+
# ELSE
|
|
1187
|
+
# def _stop_on_return(py_db, thread_info, info, step_cmd, frame, retval):
|
|
1188
|
+
# ENDIF
|
|
1189
|
+
# fmt: on
|
|
1190
|
+
back = frame.f_back
|
|
1191
|
+
if back is not None:
|
|
1192
|
+
# When we get to the pydevd run function, the debugging has actually finished for the main thread
|
|
1193
|
+
# (note that it can still go on for other threads, but for this one, we just make it finish)
|
|
1194
|
+
# So, just setting it to None should be OK
|
|
1195
|
+
back_absolute_filename, _, base = get_abs_path_real_path_and_base_from_frame(back)
|
|
1196
|
+
if (base, back.f_code.co_name) in (DEBUG_START, DEBUG_START_PY3K):
|
|
1197
|
+
back = None
|
|
1198
|
+
|
|
1199
|
+
elif base == TRACE_PROPERTY:
|
|
1200
|
+
# We dont want to trace the return event of pydevd_traceproperty (custom property for debugging)
|
|
1201
|
+
# if we're in a return, we want it to appear to the user in the previous frame!
|
|
1202
|
+
return
|
|
1203
|
+
|
|
1204
|
+
elif pydevd_dont_trace.should_trace_hook is not None:
|
|
1205
|
+
if not pydevd_dont_trace.should_trace_hook(back.f_code, back_absolute_filename):
|
|
1206
|
+
# In this case, we'll have to skip the previous one because it shouldn't be traced.
|
|
1207
|
+
# Also, we have to reset the tracing, because if the parent's parent (or some
|
|
1208
|
+
# other parent) has to be traced and it's not currently, we wouldn't stop where
|
|
1209
|
+
# we should anymore (so, a step in/over/return may not stop anywhere if no parent is traced).
|
|
1210
|
+
# Related test: _debugger_case17a.py
|
|
1211
|
+
py_db.set_trace_for_frame_and_parents(thread_info.thread_ident, back)
|
|
1212
|
+
return
|
|
1213
|
+
|
|
1214
|
+
if back is not None:
|
|
1215
|
+
# if we're in a return, we want it to appear to the user in the previous frame!
|
|
1216
|
+
py_db.set_suspend(thread_info.thread, step_cmd, original_step_cmd=info.pydev_original_step_cmd)
|
|
1217
|
+
_do_wait_suspend(py_db, thread_info, back, "return", retval)
|
|
1218
|
+
else:
|
|
1219
|
+
# in jython we may not have a back frame
|
|
1220
|
+
info.pydev_step_stop = None
|
|
1221
|
+
info.pydev_original_step_cmd = -1
|
|
1222
|
+
info.pydev_step_cmd = -1
|
|
1223
|
+
info.pydev_state = STATE_RUN
|
|
1224
|
+
info.update_stepping_info()
|
|
1225
|
+
|
|
1226
|
+
|
|
1227
|
+
# fmt: off
|
|
1228
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
1229
|
+
cdef _stop_on_breakpoint(py_db, ThreadInfo thread_info, int stop_reason, bp, frame, new_frame, bint stop, bint stop_on_plugin_breakpoint, str bp_type):
|
|
1230
|
+
cdef PyDBAdditionalThreadInfo additional_info
|
|
1231
|
+
# ELSE
|
|
1232
|
+
# def _stop_on_breakpoint(
|
|
1233
|
+
# py_db, thread_info: ThreadInfo, stop_reason: int, bp, frame, new_frame, stop: bool, stop_on_plugin_breakpoint: bool, bp_type: str
|
|
1234
|
+
# ):
|
|
1235
|
+
# ENDIF
|
|
1236
|
+
# fmt: on
|
|
1237
|
+
"""
|
|
1238
|
+
:param bp: the breakpoint hit (additional conditions will be checked now).
|
|
1239
|
+
:param frame: the actual frame
|
|
1240
|
+
:param new_frame: either the actual frame or the frame provided by the plugins.
|
|
1241
|
+
:param stop: whether we should do a regular line breakpoint.
|
|
1242
|
+
:param stop_on_plugin_breakpoint: whether we should stop in a plugin breakpoint.
|
|
1243
|
+
|
|
1244
|
+
:return:
|
|
1245
|
+
True if the breakpoint was suspended inside this function and False otherwise.
|
|
1246
|
+
Note that even if False is returned, it's still possible
|
|
1247
|
+
"""
|
|
1248
|
+
additional_info = thread_info.additional_info
|
|
1249
|
+
# ok, hit breakpoint, now, we have to discover if it is a conditional breakpoint
|
|
1250
|
+
# lets do the conditional stuff here
|
|
1251
|
+
if bp.expression is not None:
|
|
1252
|
+
# If it has an expression, it's always handled even if we don't stop.
|
|
1253
|
+
py_db.handle_breakpoint_expression(bp, additional_info, new_frame)
|
|
1254
|
+
|
|
1255
|
+
if stop or stop_on_plugin_breakpoint:
|
|
1256
|
+
if bp.has_condition:
|
|
1257
|
+
eval_result = py_db.handle_breakpoint_condition(additional_info, bp, new_frame)
|
|
1258
|
+
if not eval_result:
|
|
1259
|
+
stop = False
|
|
1260
|
+
stop_on_plugin_breakpoint = False
|
|
1261
|
+
|
|
1262
|
+
# Handle logpoint (on a logpoint we should never stop).
|
|
1263
|
+
if (stop or stop_on_plugin_breakpoint) and bp.is_logpoint:
|
|
1264
|
+
stop = False
|
|
1265
|
+
stop_on_plugin_breakpoint = False
|
|
1266
|
+
|
|
1267
|
+
if additional_info.pydev_message is not None and len(additional_info.pydev_message) > 0:
|
|
1268
|
+
cmd = py_db.cmd_factory.make_io_message(additional_info.pydev_message + os.linesep, "1")
|
|
1269
|
+
py_db.writer.add_command(cmd)
|
|
1270
|
+
|
|
1271
|
+
if stop:
|
|
1272
|
+
py_db.set_suspend(
|
|
1273
|
+
thread_info.thread,
|
|
1274
|
+
stop_reason,
|
|
1275
|
+
suspend_other_threads=bp and bp.suspend_policy == "ALL",
|
|
1276
|
+
)
|
|
1277
|
+
# print('suspend on breakpoint...')
|
|
1278
|
+
_do_wait_suspend(py_db, thread_info, frame, "line", None)
|
|
1279
|
+
return True
|
|
1280
|
+
|
|
1281
|
+
elif stop_on_plugin_breakpoint:
|
|
1282
|
+
stop_at_frame = py_db.plugin.suspend(py_db, thread_info.thread, frame, bp_type)
|
|
1283
|
+
if stop_at_frame and thread_info.additional_info.pydev_state == STATE_SUSPEND:
|
|
1284
|
+
_do_wait_suspend(py_db, thread_info, stop_at_frame, "line", None)
|
|
1285
|
+
return
|
|
1286
|
+
|
|
1287
|
+
return False
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
# fmt: off
|
|
1291
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
1292
|
+
cdef _plugin_stepping(py_db, int step_cmd, event, frame, ThreadInfo thread_info):
|
|
1293
|
+
cdef bint stop
|
|
1294
|
+
cdef dict stop_info
|
|
1295
|
+
# ELSE
|
|
1296
|
+
# def _plugin_stepping(py_db, step_cmd, event, frame, thread_info):
|
|
1297
|
+
# ENDIF
|
|
1298
|
+
# fmt: on
|
|
1299
|
+
plugin_manager = py_db.plugin
|
|
1300
|
+
# Step return makes no sense for plugins (I guess?!?), so, just handle as step into.
|
|
1301
|
+
if step_cmd in (CMD_STEP_INTO, CMD_STEP_INTO_MY_CODE, CMD_STEP_INTO_COROUTINE, CMD_SMART_STEP_INTO) or step_cmd in (
|
|
1302
|
+
CMD_STEP_RETURN,
|
|
1303
|
+
CMD_STEP_RETURN_MY_CODE,
|
|
1304
|
+
):
|
|
1305
|
+
stop_info = {}
|
|
1306
|
+
stop = False
|
|
1307
|
+
result = plugin_manager.cmd_step_into(py_db, frame, event, thread_info.additional_info, thread_info.thread, stop_info, stop)
|
|
1308
|
+
if result:
|
|
1309
|
+
stop, plugin_stop = result
|
|
1310
|
+
if plugin_stop:
|
|
1311
|
+
plugin_manager.stop(py_db, frame, event, thread_info.thread, stop_info, None, step_cmd)
|
|
1312
|
+
return
|
|
1313
|
+
|
|
1314
|
+
elif step_cmd in (CMD_STEP_OVER, CMD_STEP_OVER_MY_CODE):
|
|
1315
|
+
if plugin_manager is not None:
|
|
1316
|
+
stop_info = {}
|
|
1317
|
+
stop = False
|
|
1318
|
+
result = plugin_manager.cmd_step_over(py_db, frame, event, thread_info.additional_info, thread_info.thread, stop_info, stop)
|
|
1319
|
+
if result:
|
|
1320
|
+
stop, plugin_stop = result
|
|
1321
|
+
if plugin_stop:
|
|
1322
|
+
plugin_manager.stop(py_db, frame, event, thread_info.thread, stop_info, None, step_cmd)
|
|
1323
|
+
return
|
|
1324
|
+
|
|
1325
|
+
|
|
1326
|
+
# fmt: off
|
|
1327
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
1328
|
+
cdef _jump_event(code, int from_offset, int to_offset):
|
|
1329
|
+
cdef ThreadInfo thread_info
|
|
1330
|
+
cdef FuncCodeInfo func_code_info
|
|
1331
|
+
cdef int from_line
|
|
1332
|
+
cdef int to_line
|
|
1333
|
+
# ELSE
|
|
1334
|
+
# def _jump_event(code, from_offset, to_offset):
|
|
1335
|
+
# ENDIF
|
|
1336
|
+
# fmt: on
|
|
1337
|
+
# A bunch of things have to be repeated especially because in the sys.monitoring
|
|
1338
|
+
# everything is global, yet, when we start tracing something for stepping that
|
|
1339
|
+
# needs to be per-thread.
|
|
1340
|
+
try:
|
|
1341
|
+
thread_info = _thread_local_info.thread_info
|
|
1342
|
+
except:
|
|
1343
|
+
thread_info = _get_thread_info(True, 1)
|
|
1344
|
+
if thread_info is None:
|
|
1345
|
+
return
|
|
1346
|
+
|
|
1347
|
+
py_db: object = GlobalDebuggerHolder.global_dbg
|
|
1348
|
+
if py_db is None or py_db.pydb_disposed:
|
|
1349
|
+
return monitor.DISABLE
|
|
1350
|
+
|
|
1351
|
+
if not thread_info.trace or not is_thread_alive(thread_info.thread):
|
|
1352
|
+
# For thread-related stuff we can't disable the code tracing because other
|
|
1353
|
+
# threads may still want it...
|
|
1354
|
+
return
|
|
1355
|
+
|
|
1356
|
+
func_code_info: FuncCodeInfo = _get_func_code_info(code, 1)
|
|
1357
|
+
if func_code_info.always_skip_code or func_code_info.always_filtered_out:
|
|
1358
|
+
return monitor.DISABLE
|
|
1359
|
+
|
|
1360
|
+
# Same logic as "sys_trace_jump_func" in https://github.com/python/cpython/blob/main/Python/legacy_tracing.c
|
|
1361
|
+
|
|
1362
|
+
# Ignore forward jump.
|
|
1363
|
+
# print('jump event', code.co_name, 'from offset', from_offset, 'to offset', to_offset)
|
|
1364
|
+
if to_offset > from_offset:
|
|
1365
|
+
return monitor.DISABLE
|
|
1366
|
+
|
|
1367
|
+
from_line = func_code_info.get_line_of_offset(from_offset)
|
|
1368
|
+
to_line = func_code_info.get_line_of_offset(to_offset)
|
|
1369
|
+
# print('jump event', code.co_name, 'from line', from_line, 'to line', to_line)
|
|
1370
|
+
|
|
1371
|
+
if from_line != to_line:
|
|
1372
|
+
# I.e.: use case: "yield from [j for j in a if j % 2 == 0]"
|
|
1373
|
+
return monitor.DISABLE
|
|
1374
|
+
|
|
1375
|
+
# We know the frame depth.
|
|
1376
|
+
frame = _getframe(1)
|
|
1377
|
+
|
|
1378
|
+
# Disable the next line event as we're jumping to a line. The line event will be redundant.
|
|
1379
|
+
_thread_local_info.f_disable_next_line_if_match = frame.f_lineno
|
|
1380
|
+
|
|
1381
|
+
return _internal_line_event(func_code_info, frame, frame.f_lineno)
|
|
1382
|
+
|
|
1383
|
+
|
|
1384
|
+
# fmt: off
|
|
1385
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
1386
|
+
cdef _line_event(code, int line):
|
|
1387
|
+
cdef ThreadInfo thread_info
|
|
1388
|
+
cdef FuncCodeInfo func_code_info
|
|
1389
|
+
# ELSE
|
|
1390
|
+
# def _line_event(code, line):
|
|
1391
|
+
# ENDIF
|
|
1392
|
+
# fmt: on
|
|
1393
|
+
|
|
1394
|
+
# A bunch of things have to be repeated especially because in the sys.monitoring
|
|
1395
|
+
# everything is global, yet, when we start tracing something for stepping that
|
|
1396
|
+
# needs to be per-thread.
|
|
1397
|
+
try:
|
|
1398
|
+
thread_info = _thread_local_info.thread_info
|
|
1399
|
+
except:
|
|
1400
|
+
thread_info = _get_thread_info(True, 1)
|
|
1401
|
+
if thread_info is None:
|
|
1402
|
+
return
|
|
1403
|
+
|
|
1404
|
+
py_db: object = GlobalDebuggerHolder.global_dbg
|
|
1405
|
+
if py_db is None or py_db.pydb_disposed:
|
|
1406
|
+
return monitor.DISABLE
|
|
1407
|
+
|
|
1408
|
+
if not thread_info.trace or not is_thread_alive(thread_info.thread):
|
|
1409
|
+
# For thread-related stuff we can't disable the code tracing because other
|
|
1410
|
+
# threads may still want it...
|
|
1411
|
+
return
|
|
1412
|
+
|
|
1413
|
+
if hasattr(_thread_local_info, "f_disable_next_line_if_match"):
|
|
1414
|
+
if _thread_local_info.f_disable_next_line_if_match is line:
|
|
1415
|
+
# If we're in a jump, we should skip this line event. The jump would have
|
|
1416
|
+
# been considered a line event for this same line and we don't want to
|
|
1417
|
+
# stop twice.
|
|
1418
|
+
del _thread_local_info.f_disable_next_line_if_match
|
|
1419
|
+
return
|
|
1420
|
+
|
|
1421
|
+
func_code_info: FuncCodeInfo = _get_func_code_info(code, 1)
|
|
1422
|
+
if func_code_info.always_skip_code or func_code_info.always_filtered_out:
|
|
1423
|
+
return monitor.DISABLE
|
|
1424
|
+
|
|
1425
|
+
# print('line event', code.co_name, line)
|
|
1426
|
+
|
|
1427
|
+
# We know the frame depth.
|
|
1428
|
+
frame = _getframe(1)
|
|
1429
|
+
return _internal_line_event(func_code_info, frame, line)
|
|
1430
|
+
|
|
1431
|
+
|
|
1432
|
+
# fmt: off
|
|
1433
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
1434
|
+
cdef _internal_line_event(FuncCodeInfo func_code_info, frame, int line):
|
|
1435
|
+
cdef ThreadInfo thread_info
|
|
1436
|
+
cdef PyDBAdditionalThreadInfo info
|
|
1437
|
+
cdef int step_cmd
|
|
1438
|
+
cdef bint stop
|
|
1439
|
+
cdef bint stop_on_plugin_breakpoint
|
|
1440
|
+
cdef int stop_reason
|
|
1441
|
+
cdef bint force_check_project_scope
|
|
1442
|
+
# ELSE
|
|
1443
|
+
# def _internal_line_event(func_code_info, frame, line):
|
|
1444
|
+
# ENDIF
|
|
1445
|
+
# fmt: on
|
|
1446
|
+
py_db: object = GlobalDebuggerHolder.global_dbg
|
|
1447
|
+
thread_info = _thread_local_info.thread_info
|
|
1448
|
+
info = thread_info.additional_info
|
|
1449
|
+
|
|
1450
|
+
step_cmd = info.pydev_step_cmd
|
|
1451
|
+
|
|
1452
|
+
# print('line event', info, id(info), thread_info.thread.name)
|
|
1453
|
+
# print('line event', info.pydev_state, line, threading.current_thread(), code)
|
|
1454
|
+
# If we reached here, it was not filtered out.
|
|
1455
|
+
|
|
1456
|
+
if func_code_info.breakpoint_found:
|
|
1457
|
+
bp = None
|
|
1458
|
+
stop = False
|
|
1459
|
+
stop_on_plugin_breakpoint = False
|
|
1460
|
+
|
|
1461
|
+
stop_info = {}
|
|
1462
|
+
stop_reason = CMD_SET_BREAK
|
|
1463
|
+
bp_type = None
|
|
1464
|
+
|
|
1465
|
+
bp = func_code_info.bp_line_to_breakpoint.get(line)
|
|
1466
|
+
if bp is not None:
|
|
1467
|
+
new_frame = frame
|
|
1468
|
+
stop = True
|
|
1469
|
+
|
|
1470
|
+
if bp:
|
|
1471
|
+
if _stop_on_breakpoint(py_db, thread_info, stop_reason, bp, frame, new_frame, stop, stop_on_plugin_breakpoint, "python-line"):
|
|
1472
|
+
return
|
|
1473
|
+
|
|
1474
|
+
if func_code_info.plugin_line_breakpoint_found:
|
|
1475
|
+
result = py_db.plugin.get_breakpoint(py_db, frame, "line", info)
|
|
1476
|
+
if result:
|
|
1477
|
+
stop_reason = CMD_SET_BREAK
|
|
1478
|
+
stop = False
|
|
1479
|
+
stop_on_plugin_breakpoint = True
|
|
1480
|
+
bp, new_frame, bp_type = result
|
|
1481
|
+
_stop_on_breakpoint(py_db, thread_info, stop_reason, bp, frame, new_frame, stop, stop_on_plugin_breakpoint, bp_type)
|
|
1482
|
+
return
|
|
1483
|
+
|
|
1484
|
+
if info.pydev_state == STATE_SUSPEND:
|
|
1485
|
+
# Note: it's possible that it was suspended with a pause (and we'd stop here too).
|
|
1486
|
+
# print('suspend (pause)...')
|
|
1487
|
+
_do_wait_suspend(py_db, thread_info, frame, "line", None)
|
|
1488
|
+
return
|
|
1489
|
+
|
|
1490
|
+
# Ok, did not suspend due to a breakpoint, let's see if we're stepping.
|
|
1491
|
+
stop_frame = info.pydev_step_stop
|
|
1492
|
+
if step_cmd == -1:
|
|
1493
|
+
if func_code_info.breakpoint_found or func_code_info.plugin_line_breakpoint_found or any_thread_stepping():
|
|
1494
|
+
return None
|
|
1495
|
+
|
|
1496
|
+
return monitor.DISABLE
|
|
1497
|
+
|
|
1498
|
+
if info.suspend_type != PYTHON_SUSPEND:
|
|
1499
|
+
# Plugin stepping
|
|
1500
|
+
if func_code_info.plugin_line_stepping:
|
|
1501
|
+
_plugin_stepping(py_db, step_cmd, "line", frame, thread_info)
|
|
1502
|
+
return
|
|
1503
|
+
|
|
1504
|
+
# Python stepping now
|
|
1505
|
+
if step_cmd in (CMD_STEP_INTO, CMD_STEP_INTO_MY_CODE, CMD_STEP_INTO_COROUTINE):
|
|
1506
|
+
force_check_project_scope = step_cmd == CMD_STEP_INTO_MY_CODE
|
|
1507
|
+
if not info.pydev_use_scoped_step_frame:
|
|
1508
|
+
if func_code_info.always_filtered_out or (force_check_project_scope and func_code_info.filtered_out_force_checked):
|
|
1509
|
+
return
|
|
1510
|
+
|
|
1511
|
+
py_db.set_suspend(thread_info.thread, step_cmd, original_step_cmd=info.pydev_original_step_cmd)
|
|
1512
|
+
_do_wait_suspend(py_db, thread_info, frame, "line", None)
|
|
1513
|
+
return
|
|
1514
|
+
else:
|
|
1515
|
+
# Make sure we check the filtering inside ipython calls too...
|
|
1516
|
+
if func_code_info.always_filtered_out or (force_check_project_scope and func_code_info.filtered_out_force_checked):
|
|
1517
|
+
return
|
|
1518
|
+
|
|
1519
|
+
stop = False
|
|
1520
|
+
# We can only stop inside the ipython call.
|
|
1521
|
+
filename = frame.f_code.co_filename
|
|
1522
|
+
if filename.endswith(".pyc"):
|
|
1523
|
+
filename = filename[:-1]
|
|
1524
|
+
|
|
1525
|
+
if not filename.endswith(PYDEVD_IPYTHON_CONTEXT[0]):
|
|
1526
|
+
f = frame.f_back
|
|
1527
|
+
while f is not None:
|
|
1528
|
+
if f.f_code.co_name == PYDEVD_IPYTHON_CONTEXT[1]:
|
|
1529
|
+
f2 = f.f_back
|
|
1530
|
+
if f2 is not None and f2.f_code.co_name == PYDEVD_IPYTHON_CONTEXT[2]:
|
|
1531
|
+
pydev_log.debug("Stop inside ipython call")
|
|
1532
|
+
py_db.set_suspend(thread_info.thread, step_cmd, original_step_cmd=info.pydev_original_step_cmd)
|
|
1533
|
+
thread_info.additional_info.trace_suspend_type = "sys_monitor"
|
|
1534
|
+
_do_wait_suspend(py_db, thread_info, frame, "line", None)
|
|
1535
|
+
break
|
|
1536
|
+
f = f.f_back
|
|
1537
|
+
|
|
1538
|
+
del f
|
|
1539
|
+
|
|
1540
|
+
# In scoped mode if step in didn't work in this context it won't work
|
|
1541
|
+
# afterwards anyways.
|
|
1542
|
+
return
|
|
1543
|
+
|
|
1544
|
+
elif step_cmd in (CMD_STEP_OVER, CMD_STEP_OVER_MY_CODE):
|
|
1545
|
+
# Note: when dealing with a step over my code it's the same as a step over (the
|
|
1546
|
+
# difference is that when we return from a frame in one we go to regular step
|
|
1547
|
+
# into and in the other we go to a step into my code).
|
|
1548
|
+
if _is_same_frame(info, stop_frame, frame):
|
|
1549
|
+
py_db.set_suspend(thread_info.thread, step_cmd, original_step_cmd=info.pydev_original_step_cmd)
|
|
1550
|
+
_do_wait_suspend(py_db, thread_info, frame, "line", None)
|
|
1551
|
+
return
|
|
1552
|
+
|
|
1553
|
+
elif step_cmd == CMD_SMART_STEP_INTO:
|
|
1554
|
+
stop = False
|
|
1555
|
+
back = frame.f_back
|
|
1556
|
+
if _is_same_frame(info, stop_frame, back):
|
|
1557
|
+
if info.pydev_smart_child_offset != -1:
|
|
1558
|
+
# i.e.: in this case, we're not interested in the pause in the parent, rather
|
|
1559
|
+
# we're interested in the pause in the child (when the parent is at the proper place).
|
|
1560
|
+
stop = False
|
|
1561
|
+
|
|
1562
|
+
else:
|
|
1563
|
+
pydev_smart_parent_offset = info.pydev_smart_parent_offset
|
|
1564
|
+
|
|
1565
|
+
pydev_smart_step_into_variants = info.pydev_smart_step_into_variants
|
|
1566
|
+
if pydev_smart_parent_offset >= 0 and pydev_smart_step_into_variants:
|
|
1567
|
+
# Preferred mode (when the smart step into variants are available
|
|
1568
|
+
# and the offset is set).
|
|
1569
|
+
stop = get_smart_step_into_variant_from_frame_offset(
|
|
1570
|
+
back.f_lasti, pydev_smart_step_into_variants
|
|
1571
|
+
) is get_smart_step_into_variant_from_frame_offset(pydev_smart_parent_offset, pydev_smart_step_into_variants)
|
|
1572
|
+
|
|
1573
|
+
else:
|
|
1574
|
+
# Only the name/line is available, so, check that.
|
|
1575
|
+
curr_func_name = frame.f_code.co_name
|
|
1576
|
+
|
|
1577
|
+
# global context is set with an empty name
|
|
1578
|
+
if curr_func_name in ("?", "<module>") or curr_func_name is None:
|
|
1579
|
+
curr_func_name = ""
|
|
1580
|
+
if curr_func_name == info.pydev_func_name and stop_frame.f_lineno == info.pydev_next_line:
|
|
1581
|
+
stop = True
|
|
1582
|
+
|
|
1583
|
+
if not stop:
|
|
1584
|
+
# In smart step into, if we didn't hit it in this frame once, that'll
|
|
1585
|
+
# not be the case next time either, so, disable tracing for this frame.
|
|
1586
|
+
return
|
|
1587
|
+
|
|
1588
|
+
elif back is not None and _is_same_frame(info, stop_frame, back.f_back):
|
|
1589
|
+
# Ok, we have to track 2 stops at this point, the parent and the child offset.
|
|
1590
|
+
# This happens when handling a step into which targets a function inside a list comprehension
|
|
1591
|
+
# or generator (in which case an intermediary frame is created due to an internal function call).
|
|
1592
|
+
pydev_smart_parent_offset = info.pydev_smart_parent_offset
|
|
1593
|
+
pydev_smart_child_offset = info.pydev_smart_child_offset
|
|
1594
|
+
# print('matched back frame', pydev_smart_parent_offset, pydev_smart_child_offset)
|
|
1595
|
+
# print('parent f_lasti', back.f_back.f_lasti)
|
|
1596
|
+
# print('child f_lasti', back.f_lasti)
|
|
1597
|
+
stop = False
|
|
1598
|
+
if pydev_smart_child_offset >= 0 and pydev_smart_child_offset >= 0:
|
|
1599
|
+
pydev_smart_step_into_variants = info.pydev_smart_step_into_variants
|
|
1600
|
+
|
|
1601
|
+
if pydev_smart_parent_offset >= 0 and pydev_smart_step_into_variants:
|
|
1602
|
+
# Note that we don't really check the parent offset, only the offset of
|
|
1603
|
+
# the child (because this is a generator, the parent may have moved forward
|
|
1604
|
+
# already -- and that's ok, so, we just check that the parent frame
|
|
1605
|
+
# matches in this case).
|
|
1606
|
+
smart_step_into_variant = get_smart_step_into_variant_from_frame_offset(
|
|
1607
|
+
pydev_smart_parent_offset, pydev_smart_step_into_variants
|
|
1608
|
+
)
|
|
1609
|
+
# print('matched parent offset', pydev_smart_parent_offset)
|
|
1610
|
+
# Ok, now, check the child variant
|
|
1611
|
+
children_variants = smart_step_into_variant.children_variants
|
|
1612
|
+
stop = children_variants and (
|
|
1613
|
+
get_smart_step_into_variant_from_frame_offset(back.f_lasti, children_variants)
|
|
1614
|
+
is get_smart_step_into_variant_from_frame_offset(pydev_smart_child_offset, children_variants)
|
|
1615
|
+
)
|
|
1616
|
+
# print('stop at child', stop)
|
|
1617
|
+
|
|
1618
|
+
if not stop:
|
|
1619
|
+
# In smart step into, if we didn't hit it in this frame once, that'll
|
|
1620
|
+
# not be the case next time either, so, disable tracing for this frame.
|
|
1621
|
+
return
|
|
1622
|
+
|
|
1623
|
+
if stop:
|
|
1624
|
+
py_db.set_suspend(thread_info.thread, step_cmd, original_step_cmd=info.pydev_original_step_cmd)
|
|
1625
|
+
_do_wait_suspend(py_db, thread_info, frame, "line", None)
|
|
1626
|
+
return
|
|
1627
|
+
|
|
1628
|
+
|
|
1629
|
+
# fmt: off
|
|
1630
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
1631
|
+
cdef _start_method_event(code, instruction_offset):
|
|
1632
|
+
cdef ThreadInfo thread_info
|
|
1633
|
+
cdef FuncCodeInfo func_code_info
|
|
1634
|
+
cdef bint stop
|
|
1635
|
+
cdef int stop_reason
|
|
1636
|
+
cdef bint stop_on_plugin_breakpoint
|
|
1637
|
+
cdef PyDBAdditionalThreadInfo info
|
|
1638
|
+
cdef int step_cmd
|
|
1639
|
+
cdef bint code_tracing_added
|
|
1640
|
+
# ELSE
|
|
1641
|
+
# def _start_method_event(code, instruction_offset):
|
|
1642
|
+
# ENDIF
|
|
1643
|
+
# fmt: on
|
|
1644
|
+
try:
|
|
1645
|
+
thread_info = _thread_local_info.thread_info
|
|
1646
|
+
except:
|
|
1647
|
+
thread_info = _get_thread_info(True, 1)
|
|
1648
|
+
if thread_info is None:
|
|
1649
|
+
return
|
|
1650
|
+
|
|
1651
|
+
py_db: object = GlobalDebuggerHolder.global_dbg
|
|
1652
|
+
if py_db is None or py_db.pydb_disposed:
|
|
1653
|
+
return monitor.DISABLE
|
|
1654
|
+
|
|
1655
|
+
if not thread_info.trace or not is_thread_alive(thread_info.thread):
|
|
1656
|
+
# For thread-related stuff we can't disable the code tracing because other
|
|
1657
|
+
# threads may still want it...
|
|
1658
|
+
return
|
|
1659
|
+
|
|
1660
|
+
|
|
1661
|
+
frame = _getframe(1)
|
|
1662
|
+
func_code_info = _get_func_code_info(code, frame)
|
|
1663
|
+
if func_code_info.always_skip_code:
|
|
1664
|
+
# if DEBUG:
|
|
1665
|
+
# print('disable (always skip)')
|
|
1666
|
+
return monitor.DISABLE
|
|
1667
|
+
|
|
1668
|
+
keep_enabled: bool = _enable_code_tracing(py_db, thread_info.additional_info, func_code_info, code, frame, True)
|
|
1669
|
+
|
|
1670
|
+
if func_code_info.function_breakpoint_found:
|
|
1671
|
+
bp = func_code_info.function_breakpoint
|
|
1672
|
+
stop = True
|
|
1673
|
+
new_frame = frame
|
|
1674
|
+
stop_reason = CMD_SET_FUNCTION_BREAK
|
|
1675
|
+
stop_on_plugin_breakpoint = False
|
|
1676
|
+
|
|
1677
|
+
_stop_on_breakpoint(py_db, thread_info, stop_reason, bp, frame, new_frame, stop, stop_on_plugin_breakpoint, "python-function")
|
|
1678
|
+
return
|
|
1679
|
+
|
|
1680
|
+
if py_db.plugin:
|
|
1681
|
+
plugin_manager = py_db.plugin
|
|
1682
|
+
|
|
1683
|
+
# Check breaking on breakpoints in a 'call'
|
|
1684
|
+
info = thread_info.additional_info
|
|
1685
|
+
if func_code_info.plugin_call_breakpoint_found:
|
|
1686
|
+
result = plugin_manager.get_breakpoint(py_db, frame, "call", info)
|
|
1687
|
+
if result:
|
|
1688
|
+
stop_reason = CMD_SET_BREAK
|
|
1689
|
+
stop = False
|
|
1690
|
+
stop_on_plugin_breakpoint = True
|
|
1691
|
+
bp, new_frame, bp_type = result
|
|
1692
|
+
_stop_on_breakpoint(py_db, thread_info, stop_reason, bp, frame, new_frame, stop, stop_on_plugin_breakpoint, bp_type)
|
|
1693
|
+
return
|
|
1694
|
+
|
|
1695
|
+
keep_enabled = True
|
|
1696
|
+
|
|
1697
|
+
# Check breaking on line stepping in a 'call'
|
|
1698
|
+
step_cmd = info.pydev_step_cmd
|
|
1699
|
+
if step_cmd != -1 and func_code_info.plugin_call_stepping and info.suspend_type != PYTHON_SUSPEND:
|
|
1700
|
+
_plugin_stepping(py_db, step_cmd, "call", frame, thread_info)
|
|
1701
|
+
return
|
|
1702
|
+
|
|
1703
|
+
if keep_enabled or any_thread_stepping():
|
|
1704
|
+
return None
|
|
1705
|
+
|
|
1706
|
+
return monitor.DISABLE
|
|
1707
|
+
|
|
1708
|
+
# fmt: off
|
|
1709
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
1710
|
+
cpdef _ensure_monitoring():
|
|
1711
|
+
# ELSE
|
|
1712
|
+
# def _ensure_monitoring():
|
|
1713
|
+
# ENDIF
|
|
1714
|
+
# fmt: on
|
|
1715
|
+
DEBUGGER_ID = monitor.DEBUGGER_ID
|
|
1716
|
+
if not monitor.get_tool(DEBUGGER_ID):
|
|
1717
|
+
monitor.use_tool_id(DEBUGGER_ID, "pydevd")
|
|
1718
|
+
update_monitor_events()
|
|
1719
|
+
restart_events()
|
|
1720
|
+
|
|
1721
|
+
|
|
1722
|
+
# fmt: off
|
|
1723
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
1724
|
+
cpdef start_monitoring(bint all_threads=False):
|
|
1725
|
+
cdef ThreadInfo thread_info
|
|
1726
|
+
# ELSE
|
|
1727
|
+
# def start_monitoring(all_threads=False):
|
|
1728
|
+
# ENDIF
|
|
1729
|
+
# fmt: on
|
|
1730
|
+
if all_threads:
|
|
1731
|
+
# print('start monitoring, all_threads=', all_threads)
|
|
1732
|
+
DEBUGGER_ID = monitor.DEBUGGER_ID
|
|
1733
|
+
if not monitor.get_tool(DEBUGGER_ID):
|
|
1734
|
+
monitor.use_tool_id(DEBUGGER_ID, "pydevd")
|
|
1735
|
+
update_monitor_events()
|
|
1736
|
+
restart_events()
|
|
1737
|
+
else:
|
|
1738
|
+
try:
|
|
1739
|
+
thread_info = _thread_local_info.thread_info
|
|
1740
|
+
except:
|
|
1741
|
+
# code=None means we can already get the threading.current_thread.
|
|
1742
|
+
thread_info = _get_thread_info(True, 1)
|
|
1743
|
+
if thread_info is None:
|
|
1744
|
+
# print('start monitoring, thread=', None)
|
|
1745
|
+
return
|
|
1746
|
+
# print('start monitoring, thread=', thread_info.thread)
|
|
1747
|
+
thread_info.trace = True
|
|
1748
|
+
|
|
1749
|
+
|
|
1750
|
+
# fmt: off
|
|
1751
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
1752
|
+
cpdef stop_monitoring(all_threads=False):
|
|
1753
|
+
cdef ThreadInfo thread_info
|
|
1754
|
+
# ELSE
|
|
1755
|
+
# def stop_monitoring(all_threads=False):
|
|
1756
|
+
# ENDIF
|
|
1757
|
+
# fmt: on
|
|
1758
|
+
if all_threads:
|
|
1759
|
+
# print('stop monitoring, all_threads=', all_threads)
|
|
1760
|
+
if monitor.get_tool(monitor.DEBUGGER_ID) == "pydevd":
|
|
1761
|
+
monitor.set_events(monitor.DEBUGGER_ID, 0)
|
|
1762
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.PY_START, None)
|
|
1763
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.PY_RESUME, None)
|
|
1764
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.LINE, None)
|
|
1765
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.JUMP, None)
|
|
1766
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.PY_RETURN, None)
|
|
1767
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.RAISE, None)
|
|
1768
|
+
monitor.free_tool_id(monitor.DEBUGGER_ID)
|
|
1769
|
+
else:
|
|
1770
|
+
try:
|
|
1771
|
+
thread_info = _thread_local_info.thread_info
|
|
1772
|
+
except:
|
|
1773
|
+
thread_info = _get_thread_info(False, 1)
|
|
1774
|
+
if thread_info is None:
|
|
1775
|
+
return
|
|
1776
|
+
# print('stop monitoring, thread=', thread_info.thread)
|
|
1777
|
+
thread_info.trace = False
|
|
1778
|
+
|
|
1779
|
+
|
|
1780
|
+
def update_monitor_events(suspend_requested: Optional[bool] = None) -> None:
|
|
1781
|
+
"""
|
|
1782
|
+
This should be called when breakpoints change.
|
|
1783
|
+
|
|
1784
|
+
:param suspend: means the user requested threads to be suspended
|
|
1785
|
+
"""
|
|
1786
|
+
if monitor.get_tool(monitor.DEBUGGER_ID) != "pydevd":
|
|
1787
|
+
# It is still not initialized.
|
|
1788
|
+
return
|
|
1789
|
+
|
|
1790
|
+
# When breakpoints change we need to update what we want to track based
|
|
1791
|
+
# on the breakpoints.
|
|
1792
|
+
py_db = GlobalDebuggerHolder.global_dbg
|
|
1793
|
+
if py_db is None:
|
|
1794
|
+
return
|
|
1795
|
+
|
|
1796
|
+
if suspend_requested is None:
|
|
1797
|
+
suspend_requested = False
|
|
1798
|
+
|
|
1799
|
+
for t in threading.enumerate():
|
|
1800
|
+
if getattr(t, "pydev_do_not_trace", False):
|
|
1801
|
+
continue
|
|
1802
|
+
try:
|
|
1803
|
+
additional_info = t.additional_info
|
|
1804
|
+
if additional_info is None:
|
|
1805
|
+
# i.e.: if we don't have it then it makes no sense to check if it was suspended or is stepping
|
|
1806
|
+
continue
|
|
1807
|
+
except AttributeError:
|
|
1808
|
+
continue
|
|
1809
|
+
if additional_info.pydev_step_cmd != -1 or additional_info.pydev_state == 2:
|
|
1810
|
+
suspend_requested = True
|
|
1811
|
+
break
|
|
1812
|
+
|
|
1813
|
+
required_events = 0
|
|
1814
|
+
|
|
1815
|
+
has_caught_exception_breakpoint_in_pydb = (
|
|
1816
|
+
py_db.break_on_caught_exceptions or py_db.break_on_user_uncaught_exceptions or py_db.has_plugin_exception_breaks
|
|
1817
|
+
)
|
|
1818
|
+
|
|
1819
|
+
break_on_uncaught_exceptions = py_db.break_on_uncaught_exceptions
|
|
1820
|
+
|
|
1821
|
+
if has_caught_exception_breakpoint_in_pydb:
|
|
1822
|
+
required_events |= monitor.events.RAISE | monitor.events.PY_UNWIND
|
|
1823
|
+
# print('track RAISE')
|
|
1824
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.RAISE, _raise_event)
|
|
1825
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.PY_UNWIND, _unwind_event)
|
|
1826
|
+
else:
|
|
1827
|
+
if break_on_uncaught_exceptions:
|
|
1828
|
+
required_events |= monitor.events.PY_UNWIND
|
|
1829
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.PY_UNWIND, _unwind_event)
|
|
1830
|
+
else:
|
|
1831
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.RAISE, None)
|
|
1832
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.PY_UNWIND, None)
|
|
1833
|
+
|
|
1834
|
+
has_breaks = py_db.has_plugin_line_breaks
|
|
1835
|
+
if not has_breaks:
|
|
1836
|
+
if py_db.function_breakpoint_name_to_breakpoint:
|
|
1837
|
+
has_breaks = True
|
|
1838
|
+
else:
|
|
1839
|
+
file_to_line_to_breakpoints = py_db.breakpoints
|
|
1840
|
+
for line_to_breakpoints in file_to_line_to_breakpoints.values():
|
|
1841
|
+
if line_to_breakpoints:
|
|
1842
|
+
has_breaks = True
|
|
1843
|
+
break
|
|
1844
|
+
|
|
1845
|
+
if has_breaks or suspend_requested:
|
|
1846
|
+
# print('track PY_START|PY_RESUME, suspend_requested=', suspend_requested)
|
|
1847
|
+
required_events |= monitor.events.PY_START | monitor.events.PY_RESUME
|
|
1848
|
+
|
|
1849
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.PY_START, _start_method_event)
|
|
1850
|
+
# monitor.register_callback(DEBUGGER_ID, monitor.events.PY_RESUME, _resume_method_event)
|
|
1851
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.LINE, _line_event)
|
|
1852
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.JUMP, _jump_event)
|
|
1853
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.PY_RETURN, _return_event)
|
|
1854
|
+
|
|
1855
|
+
else:
|
|
1856
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.PY_START, None)
|
|
1857
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.PY_RESUME, None)
|
|
1858
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.LINE, None)
|
|
1859
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.JUMP, None)
|
|
1860
|
+
monitor.register_callback(DEBUGGER_ID, monitor.events.PY_RETURN, None)
|
|
1861
|
+
|
|
1862
|
+
monitor.set_events(DEBUGGER_ID, required_events)
|
|
1863
|
+
|
|
1864
|
+
|
|
1865
|
+
def restart_events() -> None:
|
|
1866
|
+
# Note: if breakpoints change, update_monitor_events usually needs to be
|
|
1867
|
+
# called first, then the line event tracing must be set for existing frames
|
|
1868
|
+
# and then this function must be called at the end.
|
|
1869
|
+
monitor.restart_events()
|
|
1870
|
+
|
|
1871
|
+
|
|
1872
|
+
# fmt: off
|
|
1873
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
1874
|
+
cdef _is_same_frame(PyDBAdditionalThreadInfo info, target_frame, current_frame):
|
|
1875
|
+
# ELSE
|
|
1876
|
+
# def _is_same_frame(info, target_frame, current_frame):
|
|
1877
|
+
# ENDIF
|
|
1878
|
+
# fmt: on
|
|
1879
|
+
if target_frame is current_frame:
|
|
1880
|
+
return True
|
|
1881
|
+
|
|
1882
|
+
if info.pydev_use_scoped_step_frame:
|
|
1883
|
+
# If using scoped step we don't check the target, we just need to check
|
|
1884
|
+
# if the current matches the same heuristic where the target was defined.
|
|
1885
|
+
if target_frame is not None and current_frame is not None:
|
|
1886
|
+
if target_frame.f_code.co_filename == current_frame.f_code.co_filename:
|
|
1887
|
+
# The co_name may be different (it may include the line number), but
|
|
1888
|
+
# the filename must still be the same.
|
|
1889
|
+
f = current_frame.f_back
|
|
1890
|
+
if f is not None and f.f_code.co_name == PYDEVD_IPYTHON_CONTEXT[1]:
|
|
1891
|
+
f = f.f_back
|
|
1892
|
+
if f is not None and f.f_code.co_name == PYDEVD_IPYTHON_CONTEXT[2]:
|
|
1893
|
+
return True
|
|
1894
|
+
|
|
1895
|
+
return False
|
|
1896
|
+
|
|
1897
|
+
|
|
1898
|
+
# fmt: off
|
|
1899
|
+
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
|
|
1900
|
+
def _do_wait_suspend(py_db, ThreadInfo thread_info, frame, event, arg):
|
|
1901
|
+
# ELSE
|
|
1902
|
+
# def _do_wait_suspend(py_db, thread_info, frame, event, arg):
|
|
1903
|
+
# ENDIF
|
|
1904
|
+
# fmt: on
|
|
1905
|
+
thread_info.additional_info.trace_suspend_type = "sys_monitor"
|
|
1906
|
+
py_db.do_wait_suspend(thread_info.thread, frame, event, arg)
|
|
1907
|
+
|
|
1908
|
+
|
|
1909
|
+
# This can be used to diagnose exceptions inside of the debugger itself.
|
|
1910
|
+
#
|
|
1911
|
+
# import types
|
|
1912
|
+
# import functools
|
|
1913
|
+
#
|
|
1914
|
+
#
|
|
1915
|
+
# def safe_func(method):
|
|
1916
|
+
#
|
|
1917
|
+
# @functools.wraps(method)
|
|
1918
|
+
# def new_method(*args, **kwargs):
|
|
1919
|
+
# try:
|
|
1920
|
+
# return method(*args, **kwargs)
|
|
1921
|
+
# except:
|
|
1922
|
+
# import traceback;traceback.print_exc()
|
|
1923
|
+
# raise
|
|
1924
|
+
#
|
|
1925
|
+
# return new_method
|
|
1926
|
+
#
|
|
1927
|
+
#
|
|
1928
|
+
# for name, obj in list(globals().items()):
|
|
1929
|
+
# if name.endswith('_event'):
|
|
1930
|
+
# if isinstance(obj, types.FunctionType):
|
|
1931
|
+
# globals()[name] = safe_func(obj)
|
|
1932
|
+
#
|
|
1933
|
+
#
|
|
1934
|
+
# def _getframe(depth):
|
|
1935
|
+
# return sys._getframe(depth + 1)
|