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