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