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