debugpy 1.8.5__zip → 1.8.6__zip

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. {debugpy-1.8.5/src/debugpy.egg-info → debugpy-1.8.6}/PKG-INFO +1 -1
  2. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_calltip_util.py +19 -21
  3. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_completer.py +30 -30
  4. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_execfile.py +3 -1
  5. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_filesystem_encoding.py +43 -0
  6. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_getopt.py +35 -32
  7. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_imports_tipper.py +83 -84
  8. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_jy_imports_tipper.py +92 -99
  9. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_log.py +2 -3
  10. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_saved_modules.py +51 -27
  11. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_sys_patch.py +11 -7
  12. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_tipper_common.py +6 -5
  13. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/fsnotify/__init__.py +34 -38
  14. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_console_utils.py +71 -69
  15. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_import_hook.py +1 -3
  16. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_imports.py +0 -1
  17. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_ipython_console.py +14 -16
  18. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_ipython_console_011.py +81 -93
  19. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_is_thread_alive.py +3 -3
  20. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_localhost.py +9 -8
  21. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_log.py +33 -25
  22. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py +183 -170
  23. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey_qt.py +33 -29
  24. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_override.py +6 -4
  25. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_umd.py +19 -18
  26. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_versioncheck.py +3 -3
  27. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles.py +165 -138
  28. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_coverage.py +77 -0
  29. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_nose.py +35 -36
  30. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_parallel.py +22 -23
  31. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_parallel_client.py +37 -57
  32. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_pytest2.py +54 -52
  33. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_unittest.py +28 -37
  34. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_xml_rpc.py +56 -53
  35. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/__main__pydevd_gen_debug_adapter_protocol.py +604 -0
  36. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/debugProtocol.json +551 -445
  37. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_base_schema.py +25 -29
  38. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_schema.py +17458 -0
  39. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_schema_log.py +11 -12
  40. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevconsole_code.py +18 -19
  41. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_additional_thread_info.py +41 -0
  42. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_additional_thread_info_regular.py +327 -0
  43. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_api.py +263 -214
  44. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_breakpoints.py +7 -10
  45. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_bytecode_utils.py +187 -92
  46. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_bytecode_utils_py311.py +105 -0
  47. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_code_to_source.py +46 -51
  48. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_collect_bytecode_info.py +239 -176
  49. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py +370 -297
  50. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm_constants.py +78 -86
  51. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_command_line_handling.py +55 -59
  52. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_concurrency_analyser/pydevd_concurrency_logger.py +194 -58
  53. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_concurrency_analyser/pydevd_thread_wrappers.py +2 -3
  54. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_console.py +18 -23
  55. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_constants.py +157 -127
  56. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_custom_frames.py +10 -12
  57. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.c +35217 -23106
  58. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.pxd +15 -0
  59. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.pyx +802 -511
  60. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython_wrapper.py +18 -7
  61. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_daemon_thread.py +32 -24
  62. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_defaults.py +11 -13
  63. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_dont_trace.py +16 -16
  64. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_dont_trace_files.py +27 -2
  65. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_exec2.py +1 -1
  66. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_extension_api.py +4 -5
  67. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_extension_utils.py +8 -10
  68. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_filtering.py +50 -45
  69. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_frame.py +462 -407
  70. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_frame_utils.py +63 -61
  71. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_gevent_integration.py +14 -16
  72. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_import_class.py +27 -25
  73. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_io.py +40 -42
  74. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_json_debug_options.py +200 -0
  75. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command.py +20 -19
  76. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_json.py +199 -108
  77. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_xml.py +121 -73
  78. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_plugin_utils.py +208 -0
  79. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command.py +206 -159
  80. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command_json.py +346 -334
  81. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_referrers.py +75 -80
  82. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_reload.py +35 -35
  83. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_resolver.py +116 -124
  84. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py +44 -58
  85. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_safe_repr.py +51 -55
  86. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_save_locals.py +4 -2
  87. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_signature.py +24 -24
  88. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_source_mapping.py +19 -20
  89. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_stackless.py +45 -49
  90. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_suspended_frames.py +61 -58
  91. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_thread_lifecycle.py +23 -13
  92. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_timeout.py +29 -31
  93. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_trace_dispatch.py +41 -11
  94. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_trace_dispatch_regular.py +117 -55
  95. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_traceproperty.py +11 -14
  96. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_utils.py +90 -89
  97. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vars.py +106 -97
  98. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vm_type.py +40 -0
  99. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_xml.py +56 -46
  100. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_cython_wrapper.py +5 -5
  101. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_main.py +71 -0
  102. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.c +11165 -5326
  103. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_tracing.py +5 -6
  104. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_modify_bytecode.py +53 -56
  105. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/__init__.py +1 -0
  106. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/bytecode.py +4 -6
  107. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/cfg.py +6 -26
  108. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/concrete.py +7 -21
  109. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/flags.py +5 -24
  110. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/instr.py +10 -34
  111. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/peephole_opt.py +1 -4
  112. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/__init__.py +2 -6
  113. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_bytecode.py +3 -5
  114. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_cfg.py +11 -31
  115. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_code.py +2 -2
  116. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_concrete.py +14 -41
  117. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_flags.py +2 -4
  118. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_instr.py +7 -18
  119. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_misc.py +6 -18
  120. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_peephole_opt.py +7 -18
  121. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/util_annotation.py +1 -3
  122. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/pydevd_fix_code.py +14 -19
  123. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/_pydevd_sys_monitoring.py +1927 -0
  124. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/_pydevd_sys_monitoring_cython.c +43058 -0
  125. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/_pydevd_sys_monitoring_cython.pxd +46 -0
  126. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/_pydevd_sys_monitoring_cython.pyx +1934 -0
  127. debugpy-1.8.6/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/pydevd_sys_monitoring.py +16 -0
  128. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_app_engine_debug_startup.py +12 -11
  129. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_coverage.py +30 -32
  130. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhook.py +58 -54
  131. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookglut.py +20 -24
  132. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookgtk.py +8 -7
  133. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookgtk3.py +8 -6
  134. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookpyglet.py +11 -8
  135. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookqt4.py +21 -18
  136. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookqt5.py +17 -15
  137. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookqt6.py +17 -15
  138. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhooktk.py +6 -4
  139. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookwx.py +14 -10
  140. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/matplotlibtools.py +30 -26
  141. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydev_ipython/qt.py +24 -0
  142. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/qt_for_kernel.py +37 -34
  143. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/qt_loaders.py +86 -73
  144. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/version.py +7 -7
  145. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydev_pysrc.py +1 -0
  146. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_run_in_console.py +23 -24
  147. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydev_sitecustomize/sitecustomize.py +267 -0
  148. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevconsole.py +55 -47
  149. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd.py +732 -508
  150. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_always_live_program.py +40 -0
  151. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_check.py +1 -0
  152. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_test_attach_to_process.py +11 -0
  153. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_test_attach_to_process_linux.py +75 -0
  154. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py +130 -125
  155. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.dll +0 -0
  156. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.pdb +0 -0
  157. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_pydevd.py +89 -0
  158. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_script.py +41 -32
  159. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.dll +0 -0
  160. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.pdb +0 -0
  161. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_utils.hpp +1 -0
  162. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_version.hpp +9 -1
  163. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.exe +0 -0
  164. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.pdb +0 -0
  165. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.exe +0 -0
  166. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.pdb +0 -0
  167. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/lldb_prepare.py +10 -9
  168. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.dll +0 -0
  169. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.pdb +0 -0
  170. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.dll +0 -0
  171. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.pdb +0 -0
  172. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/__init__.py +103 -119
  173. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/breakpoint.py +457 -516
  174. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/compat.py +33 -15
  175. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/crash.py +336 -281
  176. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/debug.py +101 -131
  177. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/disasm.py +148 -153
  178. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/event.py +310 -302
  179. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/interactive.py +235 -208
  180. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/module.py +185 -218
  181. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/process.py +428 -564
  182. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/registry.py +54 -53
  183. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/search.py +69 -73
  184. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/sql.py +158 -170
  185. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/system.py +143 -213
  186. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/textio.py +302 -333
  187. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/thread.py +220 -239
  188. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/util.py +198 -177
  189. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/__init__.py +11 -11
  190. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/advapi32.py +1191 -713
  191. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/context_amd64.py +248 -194
  192. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/context_i386.py +132 -120
  193. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/dbghelp.py +450 -346
  194. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/defines.py +305 -286
  195. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/gdi32.py +526 -0
  196. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/kernel32.py +1479 -1097
  197. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/ntdll.py +579 -0
  198. debugpy-1.8.6/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/peb_teb.py +3517 -0
  199. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/psapi.py +54 -31
  200. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/shell32.py +170 -149
  201. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/shlwapi.py +190 -108
  202. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/user32.py +542 -437
  203. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/version.py +489 -442
  204. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/wtsapi32.py +83 -65
  205. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/window.py +70 -76
  206. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/attach.cpp +17 -9
  207. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/compile_windows.bat +1 -1
  208. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_file_utils.py +141 -120
  209. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_plugins/__init__.py +1 -0
  210. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_plugins/django_debug.py +175 -149
  211. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/__init__.py +1 -0
  212. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/__init__.py +1 -0
  213. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_helpers.py +5 -5
  214. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_plugin_numpy_types.py +28 -28
  215. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_plugin_pandas_types.py +22 -30
  216. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_plugins_django_form_str.py +3 -2
  217. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_plugins/jinja2_debug.py +130 -108
  218. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_plugins/pydevd_line_validation.py +27 -14
  219. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_tracing.py +85 -66
  220. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/setup_pydevd_cython.py +96 -59
  221. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_version.py +3 -3
  222. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/common/messaging.py +2 -1
  223. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/server/cli.py +32 -17
  224. {debugpy-1.8.5 → debugpy-1.8.6/src/debugpy.egg-info}/PKG-INFO +1 -1
  225. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy.egg-info/SOURCES.txt +6 -1
  226. debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_filesystem_encoding.py +0 -41
  227. debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_coverage.py +0 -76
  228. debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/__main__pydevd_gen_debug_adapter_protocol.py +0 -592
  229. debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_schema.py +0 -19514
  230. debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_additional_thread_info.py +0 -19
  231. debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_additional_thread_info_regular.py +0 -153
  232. debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_json_debug_options.py +0 -204
  233. debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_plugin_utils.py +0 -91
  234. debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_trace_api.py +0 -62
  235. debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vm_type.py +0 -41
  236. debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_main.py +0 -48
  237. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydev_ipython/qt.py +0 -23
  238. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydev_pysrc.py +0 -1
  239. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydev_sitecustomize/sitecustomize.py +0 -237
  240. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_always_live_program.py +0 -32
  241. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_test_attach_to_process.py +0 -9
  242. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_test_attach_to_process_linux.py +0 -74
  243. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.dll +0 -0
  244. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.pdb +0 -0
  245. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_pydevd.py +0 -79
  246. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.dll +0 -0
  247. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.pdb +0 -0
  248. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.exe +0 -0
  249. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.pdb +0 -0
  250. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.pdb +0 -0
  251. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.dll +0 -0
  252. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.pdb +0 -0
  253. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.dll +0 -0
  254. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.pdb +0 -0
  255. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/gdi32.py +0 -507
  256. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/ntdll.py +0 -539
  257. debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/peb_teb.py +0 -3435
  258. {debugpy-1.8.5 → debugpy-1.8.6}/DESCRIPTION.md +0 -0
  259. {debugpy-1.8.5 → debugpy-1.8.6}/LICENSE +0 -0
  260. {debugpy-1.8.5 → debugpy-1.8.6}/MANIFEST.in +0 -0
  261. {debugpy-1.8.5 → debugpy-1.8.6}/README.md +0 -0
  262. {debugpy-1.8.5 → debugpy-1.8.6}/pyproject.toml +0 -0
  263. {debugpy-1.8.5 → debugpy-1.8.6}/setup.cfg +0 -0
  264. {debugpy-1.8.5 → debugpy-1.8.6}/setup.py +0 -0
  265. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/ThirdPartyNotices.txt +0 -0
  266. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/__init__.py +0 -0
  267. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/__main__.py +0 -0
  268. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/__init__.py +0 -0
  269. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/_pydevd_packaging.py +0 -0
  270. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/_util.py +0 -0
  271. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/force_pydevd.py +0 -0
  272. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_bundle/__init__.py +0 -0
  273. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydev_runfiles/__init__.py +0 -0
  274. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/__init__.py +0 -0
  275. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/__init__.py +0 -0
  276. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/debugProtocolCustom.json +0 -0
  277. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_concurrency_analyser/__init__.py +0 -0
  278. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/.gitignore +0 -0
  279. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/__init__.py +0 -0
  280. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pxd +0 -0
  281. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pyx +0 -0
  282. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.template.pyx +0 -0
  283. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/release_mem.h +0 -0
  284. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/README.txt +0 -0
  285. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/__init__.py +0 -0
  286. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/README +0 -0
  287. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_ipython/__init__.py +0 -0
  288. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydev_sitecustomize/__not_in_default_pythonpath.txt +0 -0
  289. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/README.txt +0 -0
  290. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace.hpp +0 -0
  291. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace_310.hpp +0 -0
  292. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace_311.hpp +0 -0
  293. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace_common.hpp +0 -0
  294. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_settrace.hpp +0 -0
  295. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/python.h +0 -0
  296. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/ref_utils.hpp +0 -0
  297. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/.gitignore +0 -0
  298. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/attach.cpp +0 -0
  299. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_linux.sh +0 -0
  300. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_mac.sh +0 -0
  301. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_manylinux.cmd +0 -0
  302. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/attach.h +0 -0
  303. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/inject_dll.cpp +0 -0
  304. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/py_win_helpers.hpp +0 -0
  305. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/run_code_in_memory.hpp +0 -0
  306. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/run_code_on_dllmain.cpp +0 -0
  307. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/stdafx.cpp +0 -0
  308. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/stdafx.h +0 -0
  309. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/targetver.h +0 -0
  310. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/README.md +0 -0
  311. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/adapter/__init__.py +0 -0
  312. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/adapter/__main__.py +0 -0
  313. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/adapter/clients.py +0 -0
  314. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/adapter/components.py +0 -0
  315. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/adapter/launchers.py +0 -0
  316. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/adapter/servers.py +0 -0
  317. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/adapter/sessions.py +0 -0
  318. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/common/__init__.py +0 -0
  319. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/common/json.py +0 -0
  320. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/common/log.py +0 -0
  321. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/common/singleton.py +0 -0
  322. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/common/sockets.py +0 -0
  323. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/common/stacks.py +0 -0
  324. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/common/timestamp.py +0 -0
  325. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/common/util.py +0 -0
  326. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/launcher/__init__.py +0 -0
  327. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/launcher/__main__.py +0 -0
  328. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/launcher/debuggee.py +0 -0
  329. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/launcher/handlers.py +0 -0
  330. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/launcher/output.py +0 -0
  331. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/launcher/winapi.py +0 -0
  332. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/public_api.py +0 -0
  333. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/server/__init__.py +0 -0
  334. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/server/api.py +0 -0
  335. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy/server/attach_pid_injected.py +0 -0
  336. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy.egg-info/dependency_links.txt +0 -0
  337. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy.egg-info/entry_points.txt +0 -0
  338. {debugpy-1.8.5 → debugpy-1.8.6}/src/debugpy.egg-info/top_level.txt +0 -0
  339. {debugpy-1.8.5 → debugpy-1.8.6}/versioneer.py +0 -0
@@ -4,65 +4,73 @@ from __future__ import print_function
4
4
 
5
5
  # DO NOT edit manually!
6
6
  # DO NOT edit manually!
7
- from _pydevd_bundle.pydevd_constants import (STATE_RUN, PYTHON_SUSPEND, SUPPORT_GEVENT, ForkSafeLock,
8
- _current_frames)
7
+ from _pydevd_bundle.pydevd_constants import (
8
+ STATE_RUN,
9
+ PYTHON_SUSPEND,
10
+ SUPPORT_GEVENT,
11
+ ForkSafeLock,
12
+ _current_frames,
13
+ STATE_SUSPEND,
14
+ get_global_debugger,
15
+ get_thread_id,
16
+ )
9
17
  from _pydev_bundle import pydev_log
10
- # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
11
- pydev_log.debug("Using Cython speedups")
12
- # ELSE
13
- # from _pydevd_bundle.pydevd_frame import PyDBFrame
14
- # ENDIF
18
+ from _pydev_bundle._pydev_saved_modules import threading
19
+ import weakref
15
20
 
16
21
  version = 11
17
22
 
18
23
 
19
- #=======================================================================================================================
24
+ # =======================================================================================================================
20
25
  # PyDBAdditionalThreadInfo
21
- #=======================================================================================================================
26
+ # =======================================================================================================================
27
+ # fmt: off
22
28
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
23
29
  cdef class PyDBAdditionalThreadInfo:
24
30
  # ELSE
25
31
  # class PyDBAdditionalThreadInfo(object):
26
32
  # ENDIF
33
+ # fmt: on
27
34
 
28
35
  # Note: the params in cython are declared in pydevd_cython.pxd.
36
+ # fmt: off
29
37
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
30
38
  # ELSE
31
39
  # __slots__ = [
32
- # 'pydev_state',
33
- # 'pydev_step_stop',
34
- # 'pydev_original_step_cmd',
35
- # 'pydev_step_cmd',
36
- # 'pydev_notify_kill',
37
- # 'pydev_django_resolve_frame',
38
- # 'pydev_call_from_jinja2',
39
- # 'pydev_call_inside_jinja2',
40
- # 'is_tracing',
41
- # 'conditional_breakpoint_exception',
42
- # 'pydev_message',
43
- # 'suspend_type',
44
- # 'pydev_next_line',
45
- # 'pydev_func_name',
46
- # 'suspended_at_unhandled',
47
- # 'trace_suspend_type',
48
- # 'top_level_thread_tracer_no_back_frames',
49
- # 'top_level_thread_tracer_unhandled',
50
- # 'thread_tracer',
51
- # 'step_in_initial_location',
52
- #
40
+ # "pydev_state",
41
+ # "pydev_step_stop",
42
+ # "pydev_original_step_cmd",
43
+ # "pydev_step_cmd",
44
+ # "pydev_notify_kill",
45
+ # "pydev_django_resolve_frame",
46
+ # "pydev_call_from_jinja2",
47
+ # "pydev_call_inside_jinja2",
48
+ # "is_tracing",
49
+ # "conditional_breakpoint_exception",
50
+ # "pydev_message",
51
+ # "suspend_type",
52
+ # "pydev_next_line",
53
+ # "pydev_func_name",
54
+ # "suspended_at_unhandled",
55
+ # "trace_suspend_type",
56
+ # "top_level_thread_tracer_no_back_frames",
57
+ # "top_level_thread_tracer_unhandled",
58
+ # "thread_tracer",
59
+ # "step_in_initial_location",
53
60
  # # Used for CMD_SMART_STEP_INTO (to know which smart step into variant to use)
54
- # 'pydev_smart_parent_offset',
55
- # 'pydev_smart_child_offset',
56
- #
61
+ # "pydev_smart_parent_offset",
62
+ # "pydev_smart_child_offset",
57
63
  # # Used for CMD_SMART_STEP_INTO (list[_pydevd_bundle.pydevd_bytecode_utils.Variant])
58
64
  # # Filled when the cmd_get_smart_step_into_variants is requested (so, this is a copy
59
65
  # # of the last request for a given thread and pydev_smart_parent_offset/pydev_smart_child_offset relies on it).
60
- # 'pydev_smart_step_into_variants',
61
- # 'target_id_to_smart_step_into_variant',
62
- #
63
- # 'pydev_use_scoped_step_frame',
66
+ # "pydev_smart_step_into_variants",
67
+ # "target_id_to_smart_step_into_variant",
68
+ # "pydev_use_scoped_step_frame",
69
+ # "weak_thread",
70
+ # "is_in_wait_loop",
64
71
  # ]
65
72
  # ENDIF
73
+ # fmt: on
66
74
 
67
75
  def __init__(self):
68
76
  self.pydev_state = STATE_RUN # STATE_RUN or STATE_SUSPEND
@@ -83,12 +91,12 @@ cdef class PyDBAdditionalThreadInfo:
83
91
  self.pydev_call_inside_jinja2 = None
84
92
  self.is_tracing = 0
85
93
  self.conditional_breakpoint_exception = None
86
- self.pydev_message = ''
94
+ self.pydev_message = ""
87
95
  self.suspend_type = PYTHON_SUSPEND
88
96
  self.pydev_next_line = -1
89
- self.pydev_func_name = '.invalid.' # Must match the type in cython
97
+ self.pydev_func_name = ".invalid." # Must match the type in cython
90
98
  self.suspended_at_unhandled = False
91
- self.trace_suspend_type = 'trace' # 'trace' or 'frame_eval'
99
+ self.trace_suspend_type = "trace" # 'trace' or 'frame_eval'
92
100
  self.top_level_thread_tracer_no_back_frames = []
93
101
  self.top_level_thread_tracer_unhandled = None
94
102
  self.thread_tracer = None
@@ -109,22 +117,80 @@ cdef class PyDBAdditionalThreadInfo:
109
117
  #
110
118
  # See: https://github.com/microsoft/debugpy/issues/869#issuecomment-1132141003
111
119
  self.pydev_use_scoped_step_frame = False
120
+ self.weak_thread = None
121
+
122
+ # Purpose: detect if this thread is suspended and actually in the wait loop
123
+ # at this time (otherwise it may be suspended but still didn't reach a point.
124
+ # to pause).
125
+ self.is_in_wait_loop = False
126
+
127
+ # fmt: off
128
+ # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
129
+ cpdef object _get_related_thread(self):
130
+ # ELSE
131
+ # def _get_related_thread(self):
132
+ # ENDIF
133
+ # fmt: on
134
+ if self.pydev_notify_kill: # Already killed
135
+ return None
136
+
137
+ if self.weak_thread is None:
138
+ return None
139
+
140
+ thread = self.weak_thread()
141
+ if thread is None:
142
+ return False
143
+
144
+ if thread._is_stopped:
145
+ return None
146
+
147
+ if thread._ident is None: # Can this happen?
148
+ pydev_log.critical("thread._ident is None in _get_related_thread!")
149
+ return None
150
+
151
+ if threading._active.get(thread._ident) is not thread:
152
+ return None
153
+
154
+ return thread
112
155
 
113
- def get_topmost_frame(self, thread):
114
- '''
156
+ # fmt: off
157
+ # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
158
+ cpdef bint _is_stepping(self):
159
+ # ELSE
160
+ # def _is_stepping(self):
161
+ # ENDIF
162
+ # fmt: on
163
+ if self.pydev_state == STATE_RUN and self.pydev_step_cmd != -1:
164
+ # This means actually stepping in a step operation.
165
+ return True
166
+
167
+ if self.pydev_state == STATE_SUSPEND and self.is_in_wait_loop:
168
+ # This means stepping because it was suspended but still didn't
169
+ # reach a suspension point.
170
+ return True
171
+
172
+ return False
173
+
174
+ # fmt: off
175
+ # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
176
+ cpdef get_topmost_frame(self, thread):
177
+ # ELSE
178
+ # def get_topmost_frame(self, thread):
179
+ # ENDIF
180
+ # fmt: on
181
+ """
115
182
  Gets the topmost frame for the given thread. Note that it may be None
116
183
  and callers should remove the reference to the frame as soon as possible
117
184
  to avoid disturbing user code.
118
- '''
185
+ """
119
186
  # sys._current_frames(): dictionary with thread id -> topmost frame
120
187
  current_frames = _current_frames()
121
- topmost_frame = current_frames.get(thread.ident)
188
+ topmost_frame = current_frames.get(thread._ident)
122
189
  if topmost_frame is None:
123
190
  # Note: this is expected for dummy threads (so, getting the topmost frame should be
124
191
  # treated as optional).
125
192
  pydev_log.info(
126
- 'Unable to get topmost frame for thread: %s, thread.ident: %s, id(thread): %s\nCurrent frames: %s.\n'
127
- 'GEVENT_SUPPORT: %s',
193
+ "Unable to get topmost frame for thread: %s, thread.ident: %s, id(thread): %s\nCurrent frames: %s.\n" "GEVENT_SUPPORT: %s",
128
194
  thread,
129
195
  thread.ident,
130
196
  id(thread),
@@ -134,15 +200,30 @@ cdef class PyDBAdditionalThreadInfo:
134
200
 
135
201
  return topmost_frame
136
202
 
203
+ # fmt: off
204
+ # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
205
+ cpdef update_stepping_info(self):
206
+ # ELSE
207
+ # def update_stepping_info(self):
208
+ # ENDIF
209
+ # fmt: on
210
+ _update_stepping_info(self)
211
+
137
212
  def __str__(self):
138
- return 'State:%s Stop:%s Cmd: %s Kill:%s' % (
139
- self.pydev_state, self.pydev_step_stop, self.pydev_step_cmd, self.pydev_notify_kill)
213
+ return "State:%s Stop:%s Cmd: %s Kill:%s" % (self.pydev_state, self.pydev_step_stop, self.pydev_step_cmd, self.pydev_notify_kill)
140
214
 
141
215
 
142
216
  _set_additional_thread_info_lock = ForkSafeLock()
217
+ _next_additional_info = [PyDBAdditionalThreadInfo()]
143
218
 
144
219
 
145
- def set_additional_thread_info(thread):
220
+ # fmt: off
221
+ # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
222
+ cpdef set_additional_thread_info(thread):
223
+ # ELSE
224
+ # def set_additional_thread_info(thread):
225
+ # ENDIF
226
+ # fmt: on
146
227
  try:
147
228
  additional_info = thread.additional_info
148
229
  if additional_info is None:
@@ -151,25 +232,125 @@ def set_additional_thread_info(thread):
151
232
  with _set_additional_thread_info_lock:
152
233
  # If it's not there, set it within a lock to avoid any racing
153
234
  # conditions.
154
- additional_info = getattr(thread, 'additional_info', None)
235
+ try:
236
+ additional_info = thread.additional_info
237
+ except:
238
+ additional_info = None
239
+
155
240
  if additional_info is None:
156
- additional_info = PyDBAdditionalThreadInfo()
157
- thread.additional_info = additional_info
241
+ # Note: don't call PyDBAdditionalThreadInfo constructor at this
242
+ # point as it can piggy-back into the debugger which could
243
+ # get here again, rather get the global ref which was pre-created
244
+ # and add a new entry only after we set thread.additional_info.
245
+ additional_info = _next_additional_info[0]
246
+ thread.additional_info = additional_info
247
+ additional_info.weak_thread = weakref.ref(thread)
248
+ add_additional_info(additional_info)
249
+ del _next_additional_info[:]
250
+ _next_additional_info.append(PyDBAdditionalThreadInfo())
158
251
 
159
252
  return additional_info
253
+
254
+
255
+ # fmt: off
256
+ # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
257
+ cdef set _all_infos
258
+ cdef set _infos_stepping
259
+ cdef object _update_infos_lock
260
+ # ELSE
261
+ # ENDIF
262
+ # fmt: on
263
+
264
+ _all_infos = set()
265
+ _infos_stepping = set()
266
+ _update_infos_lock = ForkSafeLock()
267
+
268
+
269
+ # fmt: off
270
+ # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
271
+ cdef _update_stepping_info(PyDBAdditionalThreadInfo info):
272
+ # ELSE
273
+ # def _update_stepping_info(info):
274
+ # ENDIF
275
+ # fmt: on
276
+
277
+ global _infos_stepping
278
+ global _all_infos
279
+
280
+ with _update_infos_lock:
281
+ # Removes entries that are no longer valid.
282
+ new_all_infos = set()
283
+ for info in _all_infos:
284
+ if info._get_related_thread() is not None:
285
+ new_all_infos.add(info)
286
+ _all_infos = new_all_infos
287
+
288
+ new_stepping = set()
289
+ for info in _all_infos:
290
+ if info._is_stepping():
291
+ new_stepping.add(info)
292
+ _infos_stepping = new_stepping
293
+
294
+ py_db = get_global_debugger()
295
+ if py_db is not None and not py_db.pydb_disposed:
296
+ thread = info.weak_thread()
297
+ if thread is not None:
298
+ thread_id = get_thread_id(thread)
299
+ _queue, event = py_db.get_internal_queue_and_event(thread_id)
300
+ event.set()
301
+
302
+ # fmt: off
303
+ # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
304
+ cpdef add_additional_info(PyDBAdditionalThreadInfo info):
305
+ # ELSE
306
+ # def add_additional_info(info):
307
+ # ENDIF
308
+ # fmt: on
309
+ with _update_infos_lock:
310
+ _all_infos.add(info)
311
+ if info._is_stepping():
312
+ _infos_stepping.add(info)
313
+
314
+ # fmt: off
315
+ # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
316
+ cpdef remove_additional_info(PyDBAdditionalThreadInfo info):
317
+ # ELSE
318
+ # def remove_additional_info(info):
319
+ # ENDIF
320
+ # fmt: on
321
+ with _update_infos_lock:
322
+ _all_infos.discard(info)
323
+ _infos_stepping.discard(info)
324
+
325
+
326
+ # fmt: off
327
+ # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
328
+ cpdef bint any_thread_stepping():
329
+ # ELSE
330
+ # def any_thread_stepping():
331
+ # ENDIF
332
+ # fmt: on
333
+ return bool(_infos_stepping)
160
334
  import linecache
161
335
  import os.path
162
336
  import re
163
337
 
164
338
  from _pydev_bundle import pydev_log
165
339
  from _pydevd_bundle import pydevd_dont_trace
166
- from _pydevd_bundle.pydevd_constants import (RETURN_VALUES_DICT, NO_FTRACE,
167
- EXCEPTION_TYPE_HANDLED, EXCEPTION_TYPE_USER_UNHANDLED, PYDEVD_IPYTHON_CONTEXT)
340
+ from _pydevd_bundle.pydevd_constants import (
341
+ RETURN_VALUES_DICT,
342
+ NO_FTRACE,
343
+ EXCEPTION_TYPE_HANDLED,
344
+ EXCEPTION_TYPE_USER_UNHANDLED,
345
+ PYDEVD_IPYTHON_CONTEXT,
346
+ PYDEVD_USE_SYS_MONITORING,
347
+ )
168
348
  from _pydevd_bundle.pydevd_frame_utils import add_exception_to_frame, just_raised, remove_exception_from_frame, ignore_exception_trace
169
349
  from _pydevd_bundle.pydevd_utils import get_clsname_for_code
170
350
  from pydevd_file_utils import get_abs_path_real_path_and_base_from_frame
171
351
  from _pydevd_bundle.pydevd_comm_constants import constant_to_str, CMD_SET_FUNCTION_BREAK
172
352
  import sys
353
+
173
354
  try:
174
355
  from _pydevd_bundle.pydevd_bytecode_utils import get_smart_step_into_variant_from_frame_offset
175
356
  except ImportError:
@@ -177,6 +358,7 @@ except ImportError:
177
358
  def get_smart_step_into_variant_from_frame_offset(*args, **kwargs):
178
359
  return None
179
360
 
361
+
180
362
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
181
363
  # ELSE
182
364
  # # Note: those are now inlined on cython.
@@ -196,10 +378,10 @@ except ImportError:
196
378
 
197
379
  basename = os.path.basename
198
380
 
199
- IGNORE_EXCEPTION_TAG = re.compile('[^#]*#.*@IgnoreException')
200
- DEBUG_START = ('pydevd.py', 'run')
201
- DEBUG_START_PY3K = ('_pydev_execfile.py', 'execfile')
202
- TRACE_PROPERTY = 'pydevd_traceproperty.py'
381
+ IGNORE_EXCEPTION_TAG = re.compile("[^#]*#.*@IgnoreException")
382
+ DEBUG_START = ("pydevd.py", "run")
383
+ DEBUG_START_PY3K = ("_pydev_execfile.py", "execfile")
384
+ TRACE_PROPERTY = "pydevd_traceproperty.py"
203
385
 
204
386
  import dis
205
387
 
@@ -210,10 +392,10 @@ except NameError:
210
392
 
211
393
 
212
394
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
213
- cdef is_unhandled_exception(container_obj, py_db, frame, int last_raise_line, set raise_lines):
395
+ def is_unhandled_exception(container_obj, py_db, frame, int last_raise_line, set raise_lines):
214
396
  # ELSE
215
397
  # def is_unhandled_exception(container_obj, py_db, frame, last_raise_line, raise_lines):
216
- # ENDIF
398
+ # ENDIF
217
399
  if frame.f_lineno in raise_lines:
218
400
  return True
219
401
 
@@ -242,10 +424,7 @@ cdef is_unhandled_exception(container_obj, py_db, frame, int last_raise_line, se
242
424
  # and it's gotten in the except line.
243
425
  for try_except_info in try_except_infos:
244
426
  if try_except_info.is_line_in_except_block(frame.f_lineno):
245
- if (
246
- frame.f_lineno == try_except_info.except_line or
247
- frame.f_lineno in try_except_info.raise_lines_in_except
248
- ):
427
+ if frame.f_lineno == try_except_info.except_line or frame.f_lineno in try_except_info.raise_lines_in_except:
249
428
  # In a raise inside a try..except block or some except which doesn't
250
429
  # match the raised exception.
251
430
  return True
@@ -259,33 +438,30 @@ cdef class _TryExceptContainerObj:
259
438
  self.try_except_infos = None
260
439
  # ELSE
261
440
  # class _TryExceptContainerObj(object):
262
- # '''
263
- # A dumb container object just to containe the try..except info when needed. Meant to be
264
- # persisent among multiple PyDBFrames to the same code object.
265
- # '''
441
+ # """
442
+ # A dumb container object just to contain the try..except info when needed. Meant to be
443
+ # persistent among multiple PyDBFrames to the same code object.
444
+ # """
445
+ #
266
446
  # try_except_infos = None
447
+ #
448
+ #
267
449
  # ENDIF
268
450
 
269
451
 
270
- #=======================================================================================================================
452
+ # =======================================================================================================================
271
453
  # PyDBFrame
272
- #=======================================================================================================================
454
+ # =======================================================================================================================
273
455
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
274
456
  cdef class PyDBFrame:
275
457
  # ELSE
276
458
  # class PyDBFrame:
277
- # '''This makes the tracing for a given frame, so, the trace_dispatch
459
+ # """This makes the tracing for a given frame, so, the trace_dispatch
278
460
  # is used initially when we enter into a new context ('call') and then
279
461
  # is reused for the entire context.
280
- # '''
281
- # ENDIF
282
-
283
- # Note: class (and not instance) attributes.
284
-
285
- # Same thing in the main debugger but only considering the file contents, while the one in the main debugger
286
- # considers the user input (so, the actual result must be a join of both).
287
- filename_to_lines_where_exceptions_are_ignored = {}
288
- filename_to_stat_info = {}
462
+ # """
463
+ #
464
+ # ENDIF
289
465
 
290
466
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
291
467
  cdef tuple _args
@@ -299,10 +475,17 @@ cdef class PyDBFrame:
299
475
  # should_skip = -1 # Default value in class (put in instance on set).
300
476
  # exc_info = () # Default value in class (put in instance on set).
301
477
  #
302
- # def __init__(self, args):
303
- # # args = main_debugger, abs_path_canonical_path_and_base, base, info, t, frame
304
- # # yeap, much faster than putting in self and then getting it from self later on
305
- # self._args = args
478
+ # if PYDEVD_USE_SYS_MONITORING:
479
+ #
480
+ # def __init__(self, *args, **kwargs):
481
+ # raise RuntimeError("Not expected to be used in sys.monitoring.")
482
+ #
483
+ # else:
484
+ #
485
+ # def __init__(self, args):
486
+ # # args = py_db, abs_path_canonical_path_and_base, base, info, t, frame
487
+ # # yeap, much faster than putting in self and then getting it from self later on
488
+ # self._args = args
306
489
  # ENDIF
307
490
 
308
491
  def set_suspend(self, *args, **kwargs):
@@ -317,291 +500,42 @@ cdef class PyDBFrame:
317
500
  cdef tuple exc_info;
318
501
  # ELSE
319
502
  # def trace_exception(self, frame, event, arg):
320
- # ENDIF
321
- if event == 'exception':
322
- should_stop, frame = self._should_stop_on_exception(frame, event, arg)
503
+ # ENDIF
504
+ if event == "exception":
505
+ should_stop, frame, exc_info = should_stop_on_exception(self._args[0], self._args[2], frame, self._args[3], arg, self.exc_info)
506
+ self.exc_info = exc_info
323
507
 
324
508
  if should_stop:
325
- if self._handle_exception(frame, event, arg, EXCEPTION_TYPE_HANDLED):
509
+ if handle_exception(self._args[0], self._args[3], frame, arg, EXCEPTION_TYPE_HANDLED):
326
510
  return self.trace_dispatch
327
511
 
328
- elif event == 'return':
512
+ elif event == "return":
329
513
  exc_info = self.exc_info
330
514
  if exc_info and arg is None:
331
515
  frame_skips_cache, frame_cache_key = self._args[4], self._args[5]
332
- custom_key = (frame_cache_key, 'try_exc_info')
516
+ custom_key = (frame_cache_key, "try_exc_info")
333
517
  container_obj = frame_skips_cache.get(custom_key)
334
518
  if container_obj is None:
335
519
  container_obj = frame_skips_cache[custom_key] = _TryExceptContainerObj()
336
- if is_unhandled_exception(container_obj, self._args[0], frame, exc_info[1], exc_info[2]) and \
337
- self.handle_user_exception(frame):
520
+ if is_unhandled_exception(container_obj, self._args[0], frame, exc_info[1], exc_info[2]) and self.handle_user_exception(
521
+ frame
522
+ ):
338
523
  return self.trace_dispatch
339
524
 
340
525
  return self.trace_exception
341
526
 
342
- # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
343
- cdef _should_stop_on_exception(self, frame, str event, arg):
344
- cdef PyDBAdditionalThreadInfo info;
345
- cdef bint should_stop;
346
- cdef bint was_just_raised;
347
- cdef list check_excs;
348
- # ELSE
349
- # def _should_stop_on_exception(self, frame, event, arg):
350
- # ENDIF
351
-
352
- # main_debugger, _filename, info, _thread = self._args
353
- main_debugger = self._args[0]
354
- info = self._args[2]
355
- should_stop = False
356
-
357
- # 2 = 2
358
- if info.pydev_state != 2: # and breakpoint is not None:
359
- exception, value, trace = arg
360
-
361
- if trace is not None and hasattr(trace, 'tb_next'):
362
- # on jython trace is None on the first event and it may not have a tb_next.
363
-
364
- should_stop = False
365
- exception_breakpoint = None
366
- try:
367
- if main_debugger.plugin is not None:
368
- result = main_debugger.plugin.exception_break(main_debugger, self, frame, self._args, arg)
369
- if result:
370
- should_stop, frame = result
371
- except:
372
- pydev_log.exception()
373
-
374
- if not should_stop:
375
- # Apply checks that don't need the exception breakpoint (where we shouldn't ever stop).
376
- if exception == SystemExit and main_debugger.ignore_system_exit_code(value):
377
- pass
378
-
379
- elif exception in (GeneratorExit, StopIteration, StopAsyncIteration):
380
- # These exceptions are control-flow related (they work as a generator
381
- # pause), so, we shouldn't stop on them.
382
- pass
383
-
384
- elif ignore_exception_trace(trace):
385
- pass
386
-
387
- else:
388
- was_just_raised = trace.tb_next is None
389
-
390
- # It was not handled by any plugin, lets check exception breakpoints.
391
- check_excs = []
392
-
393
- # Note: check user unhandled before regular exceptions.
394
- exc_break_user = main_debugger.get_exception_breakpoint(
395
- exception, main_debugger.break_on_user_uncaught_exceptions)
396
- if exc_break_user is not None:
397
- check_excs.append((exc_break_user, True))
398
-
399
- exc_break_caught = main_debugger.get_exception_breakpoint(
400
- exception, main_debugger.break_on_caught_exceptions)
401
- if exc_break_caught is not None:
402
- check_excs.append((exc_break_caught, False))
403
-
404
- for exc_break, is_user_uncaught in check_excs:
405
- # Initially mark that it should stop and then go into exclusions.
406
- should_stop = True
407
-
408
- if main_debugger.exclude_exception_by_filter(exc_break, trace):
409
- pydev_log.debug("Ignore exception %s in library %s -- (%s)" % (exception, frame.f_code.co_filename, frame.f_code.co_name))
410
- should_stop = False
411
-
412
- elif exc_break.condition is not None and \
413
- not main_debugger.handle_breakpoint_condition(info, exc_break, frame):
414
- should_stop = False
415
-
416
- elif is_user_uncaught:
417
- # Note: we don't stop here, we just collect the exc_info to use later on...
418
- should_stop = False
419
- if not main_debugger.apply_files_filter(frame, frame.f_code.co_filename, True) \
420
- and (frame.f_back is None or main_debugger.apply_files_filter(frame.f_back, frame.f_back.f_code.co_filename, True)):
421
- # User uncaught means that we're currently in user code but the code
422
- # up the stack is library code.
423
- exc_info = self.exc_info
424
- if not exc_info:
425
- exc_info = (arg, frame.f_lineno, set([frame.f_lineno]))
426
- else:
427
- lines = exc_info[2]
428
- lines.add(frame.f_lineno)
429
- exc_info = (arg, frame.f_lineno, lines)
430
- self.exc_info = exc_info
431
- else:
432
- # I.e.: these are only checked if we're not dealing with user uncaught exceptions.
433
- if exc_break.notify_on_first_raise_only and main_debugger.skip_on_exceptions_thrown_in_same_context \
434
- and not was_just_raised and not just_raised(trace.tb_next):
435
- # In this case we never stop if it was just raised, so, to know if it was the first we
436
- # need to check if we're in the 2nd method.
437
- should_stop = False # I.e.: we stop only when we're at the caller of a method that throws an exception
438
-
439
- elif exc_break.notify_on_first_raise_only and not main_debugger.skip_on_exceptions_thrown_in_same_context \
440
- and not was_just_raised:
441
- should_stop = False # I.e.: we stop only when it was just raised
442
-
443
- elif was_just_raised and main_debugger.skip_on_exceptions_thrown_in_same_context:
444
- # Option: Don't break if an exception is caught in the same function from which it is thrown
445
- should_stop = False
446
-
447
- if should_stop:
448
- exception_breakpoint = exc_break
449
- try:
450
- info.pydev_message = exc_break.qname
451
- except:
452
- info.pydev_message = exc_break.qname.encode('utf-8')
453
- break
454
-
455
- if should_stop:
456
- # Always add exception to frame (must remove later after we proceed).
457
- add_exception_to_frame(frame, (exception, value, trace))
458
-
459
- if exception_breakpoint is not None and exception_breakpoint.expression is not None:
460
- main_debugger.handle_breakpoint_expression(exception_breakpoint, info, frame)
461
-
462
- return should_stop, frame
463
-
464
527
  def handle_user_exception(self, frame):
465
528
  exc_info = self.exc_info
466
529
  if exc_info:
467
- return self._handle_exception(frame, 'exception', exc_info[0], EXCEPTION_TYPE_USER_UNHANDLED)
530
+ return handle_exception(self._args[0], self._args[3], frame, exc_info[0], EXCEPTION_TYPE_USER_UNHANDLED)
468
531
  return False
469
532
 
470
- # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
471
- cdef _handle_exception(self, frame, str event, arg, str exception_type):
472
- cdef bint stopped;
473
- cdef tuple abs_real_path_and_base;
474
- cdef str absolute_filename;
475
- cdef str canonical_normalized_filename;
476
- cdef dict filename_to_lines_where_exceptions_are_ignored;
477
- cdef dict lines_ignored;
478
- cdef dict frame_id_to_frame;
479
- cdef dict merged;
480
- cdef object trace_obj;
481
- cdef object main_debugger;
482
- # ELSE
483
- # def _handle_exception(self, frame, event, arg, exception_type):
484
- # ENDIF
485
- stopped = False
486
- try:
487
- # print('_handle_exception', frame.f_lineno, frame.f_code.co_name)
488
-
489
- # We have 3 things in arg: exception type, description, traceback object
490
- trace_obj = arg[2]
491
- main_debugger = self._args[0]
492
-
493
- initial_trace_obj = trace_obj
494
- if trace_obj.tb_next is None and trace_obj.tb_frame is frame:
495
- # I.e.: tb_next should be only None in the context it was thrown (trace_obj.tb_frame is frame is just a double check).
496
- pass
497
- else:
498
- # Get the trace_obj from where the exception was raised...
499
- while trace_obj.tb_next is not None:
500
- trace_obj = trace_obj.tb_next
501
-
502
- if main_debugger.ignore_exceptions_thrown_in_lines_with_ignore_exception:
503
- for check_trace_obj in (initial_trace_obj, trace_obj):
504
- abs_real_path_and_base = get_abs_path_real_path_and_base_from_frame(check_trace_obj.tb_frame)
505
- absolute_filename = abs_real_path_and_base[0]
506
- canonical_normalized_filename = abs_real_path_and_base[1]
507
-
508
- filename_to_lines_where_exceptions_are_ignored = self.filename_to_lines_where_exceptions_are_ignored
509
-
510
- lines_ignored = filename_to_lines_where_exceptions_are_ignored.get(canonical_normalized_filename)
511
- if lines_ignored is None:
512
- lines_ignored = filename_to_lines_where_exceptions_are_ignored[canonical_normalized_filename] = {}
513
-
514
- try:
515
- curr_stat = os.stat(absolute_filename)
516
- curr_stat = (curr_stat.st_size, curr_stat.st_mtime)
517
- except:
518
- curr_stat = None
519
-
520
- last_stat = self.filename_to_stat_info.get(absolute_filename)
521
- if last_stat != curr_stat:
522
- self.filename_to_stat_info[absolute_filename] = curr_stat
523
- lines_ignored.clear()
524
- try:
525
- linecache.checkcache(absolute_filename)
526
- except:
527
- pydev_log.exception('Error in linecache.checkcache(%r)', absolute_filename)
528
-
529
- from_user_input = main_debugger.filename_to_lines_where_exceptions_are_ignored.get(canonical_normalized_filename)
530
- if from_user_input:
531
- merged = {}
532
- merged.update(lines_ignored)
533
- # Override what we have with the related entries that the user entered
534
- merged.update(from_user_input)
535
- else:
536
- merged = lines_ignored
537
-
538
- exc_lineno = check_trace_obj.tb_lineno
539
-
540
- # print ('lines ignored', lines_ignored)
541
- # print ('user input', from_user_input)
542
- # print ('merged', merged, 'curr', exc_lineno)
543
-
544
- if exc_lineno not in merged: # Note: check on merged but update lines_ignored.
545
- try:
546
- line = linecache.getline(absolute_filename, exc_lineno, check_trace_obj.tb_frame.f_globals)
547
- except:
548
- pydev_log.exception('Error in linecache.getline(%r, %s, f_globals)', absolute_filename, exc_lineno)
549
- line = ''
550
-
551
- if IGNORE_EXCEPTION_TAG.match(line) is not None:
552
- lines_ignored[exc_lineno] = 1
553
- return False
554
- else:
555
- # Put in the cache saying not to ignore
556
- lines_ignored[exc_lineno] = 0
557
- else:
558
- # Ok, dict has it already cached, so, let's check it...
559
- if merged.get(exc_lineno, 0):
560
- return False
561
-
562
- thread = self._args[3]
563
-
564
- try:
565
- frame_id_to_frame = {}
566
- frame_id_to_frame[id(frame)] = frame
567
- f = trace_obj.tb_frame
568
- while f is not None:
569
- frame_id_to_frame[id(f)] = f
570
- f = f.f_back
571
- f = None
572
-
573
- stopped = True
574
- main_debugger.send_caught_exception_stack(thread, arg, id(frame))
575
- try:
576
- self.set_suspend(thread, 137)
577
- self.do_wait_suspend(thread, frame, event, arg, exception_type=exception_type)
578
- finally:
579
- main_debugger.send_caught_exception_stack_proceeded(thread)
580
- except:
581
- pydev_log.exception()
582
-
583
- main_debugger.set_trace_for_frame_and_parents(frame)
584
- finally:
585
- # Make sure the user cannot see the '__exception__' we added after we leave the suspend state.
586
- remove_exception_from_frame(frame)
587
- # Clear some local variables...
588
- frame = None
589
- trace_obj = None
590
- initial_trace_obj = None
591
- check_trace_obj = None
592
- f = None
593
- frame_id_to_frame = None
594
- main_debugger = None
595
- thread = None
596
-
597
- return stopped
598
-
599
533
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
600
534
  cdef get_func_name(self, frame):
601
535
  cdef str func_name
602
536
  # ELSE
603
537
  # def get_func_name(self, frame):
604
- # ENDIF
538
+ # ENDIF
605
539
  code_obj = frame.f_code
606
540
  func_name = code_obj.co_name
607
541
  try:
@@ -618,7 +552,7 @@ cdef class PyDBFrame:
618
552
  cdef _show_return_values(self, frame, arg):
619
553
  # ELSE
620
554
  # def _show_return_values(self, frame, arg):
621
- # ENDIF
555
+ # ENDIF
622
556
  try:
623
557
  try:
624
558
  f_locals_back = getattr(frame.f_back, "f_locals", None)
@@ -635,10 +569,10 @@ cdef class PyDBFrame:
635
569
  f_locals_back = None
636
570
 
637
571
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
638
- cdef _remove_return_values(self, main_debugger, frame):
572
+ cdef _remove_return_values(self, py_db, frame):
639
573
  # ELSE
640
- # def _remove_return_values(self, main_debugger, frame):
641
- # ENDIF
574
+ # def _remove_return_values(self, py_db, frame):
575
+ # ENDIF
642
576
  try:
643
577
  try:
644
578
  # Showing return values was turned off, we should remove them from locals dict.
@@ -654,17 +588,17 @@ cdef class PyDBFrame:
654
588
  f_locals_back = None
655
589
 
656
590
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
657
- cdef _get_unfiltered_back_frame(self, main_debugger, frame):
591
+ cdef _get_unfiltered_back_frame(self, py_db, frame):
658
592
  # ELSE
659
- # def _get_unfiltered_back_frame(self, main_debugger, frame):
660
- # ENDIF
593
+ # def _get_unfiltered_back_frame(self, py_db, frame):
594
+ # ENDIF
661
595
  f = frame.f_back
662
596
  while f is not None:
663
- if not main_debugger.is_files_filter_enabled:
597
+ if not py_db.is_files_filter_enabled:
664
598
  return f
665
599
 
666
600
  else:
667
- if main_debugger.apply_files_filter(f, f.f_code.co_filename, False):
601
+ if py_db.apply_files_filter(f, f.f_code.co_filename, False):
668
602
  f = f.f_back
669
603
 
670
604
  else:
@@ -677,7 +611,7 @@ cdef class PyDBFrame:
677
611
  cdef PyDBAdditionalThreadInfo info;
678
612
  # ELSE
679
613
  # def _is_same_frame(self, target_frame, current_frame):
680
- # ENDIF
614
+ # ENDIF
681
615
  if target_frame is current_frame:
682
616
  return True
683
617
 
@@ -729,7 +663,7 @@ cdef class PyDBFrame:
729
663
  cdef tuple pydev_smart_step_into_variants
730
664
  # ELSE
731
665
  # def trace_dispatch(self, frame, event, arg):
732
- # ENDIF
666
+ # ENDIF
733
667
  # Note: this is a big function because most of the logic related to hitting a breakpoint and
734
668
  # stepping is contained in it. Ideally this could be split among multiple functions, but the
735
669
  # problem in this case is that in pure-python function calls are expensive and even more so
@@ -739,8 +673,8 @@ cdef class PyDBFrame:
739
673
  # generation be better split among what each part does).
740
674
 
741
675
  try:
742
- # DEBUG = '_debugger_case_generator.py' in frame.f_code.co_filename
743
- main_debugger, abs_path_canonical_path_and_base, info, thread, frame_skips_cache, frame_cache_key = self._args
676
+ # DEBUG = '_debugger_case_yield_from.py' in frame.f_code.co_filename
677
+ py_db, abs_path_canonical_path_and_base, info, thread, frame_skips_cache, frame_cache_key = self._args
744
678
  # if DEBUG: print('frame trace_dispatch %s %s %s %s %s %s, stop: %s' % (frame.f_lineno, frame.f_code.co_name, frame.f_code.co_filename, event, constant_to_str(info.pydev_step_cmd), arg, info.pydev_step_stop))
745
679
  info.is_tracing += 1
746
680
 
@@ -750,36 +684,35 @@ cdef class PyDBFrame:
750
684
  line = frame.f_lineno or 0 # Workaround or case where frame.f_lineno is None
751
685
  line_cache_key = (frame_cache_key, line)
752
686
 
753
- if main_debugger.pydb_disposed:
754
- return None if event == 'call' else NO_FTRACE
687
+ if py_db.pydb_disposed:
688
+ return None if event == "call" else NO_FTRACE
755
689
 
756
- plugin_manager = main_debugger.plugin
690
+ plugin_manager = py_db.plugin
757
691
  has_exception_breakpoints = (
758
- main_debugger.break_on_caught_exceptions
759
- or main_debugger.break_on_user_uncaught_exceptions
760
- or main_debugger.has_plugin_exception_breaks)
692
+ py_db.break_on_caught_exceptions or py_db.break_on_user_uncaught_exceptions or py_db.has_plugin_exception_breaks
693
+ )
761
694
 
762
695
  stop_frame = info.pydev_step_stop
763
696
  step_cmd = info.pydev_step_cmd
764
697
  function_breakpoint_on_call_event = None
765
698
 
766
- if frame.f_code.co_flags & 0xa0: # 0xa0 == CO_GENERATOR = 0x20 | CO_COROUTINE = 0x80
699
+ if frame.f_code.co_flags & 0xA0: # 0xa0 == CO_GENERATOR = 0x20 | CO_COROUTINE = 0x80
767
700
  # Dealing with coroutines and generators:
768
701
  # When in a coroutine we change the perceived event to the debugger because
769
702
  # a call, StopIteration exception and return are usually just pausing/unpausing it.
770
- if event == 'line':
703
+ if event == "line":
771
704
  is_line = True
772
705
  is_call = False
773
706
  is_return = False
774
707
  is_exception_event = False
775
708
 
776
- elif event == 'return':
709
+ elif event == "return":
777
710
  is_line = False
778
711
  is_call = False
779
712
  is_return = True
780
713
  is_exception_event = False
781
714
 
782
- returns_cache_key = (frame_cache_key, 'returns')
715
+ returns_cache_key = (frame_cache_key, "returns")
783
716
  return_lines = frame_skips_cache.get(returns_cache_key)
784
717
  if return_lines is None:
785
718
  # Note: we're collecting the return lines by inspecting the bytecode as
@@ -787,7 +720,7 @@ cdef class PyDBFrame:
787
720
  # it doesn't give any clear indication when a coroutine or generator is
788
721
  # finishing or just pausing.
789
722
  return_lines = set()
790
- for x in main_debugger.collect_return_info(frame.f_code):
723
+ for x in py_db.collect_return_info(frame.f_code):
791
724
  # Note: cython does not support closures in cpdefs (so we can't use
792
725
  # a list comprehension).
793
726
  return_lines.add(x.return_line)
@@ -820,7 +753,7 @@ cdef class PyDBFrame:
820
753
  # frame in this case).
821
754
  if stop_frame is frame and not info.pydev_use_scoped_step_frame:
822
755
  if step_cmd in (108, 159, 107, 144):
823
- f = self._get_unfiltered_back_frame(main_debugger, frame)
756
+ f = self._get_unfiltered_back_frame(py_db, frame)
824
757
  if f is not None:
825
758
  info.pydev_step_cmd = 206
826
759
  info.pydev_step_stop = f
@@ -835,19 +768,22 @@ cdef class PyDBFrame:
835
768
 
836
769
  elif step_cmd == 206:
837
770
  # We're exiting this one, so, mark the new coroutine context.
838
- f = self._get_unfiltered_back_frame(main_debugger, frame)
771
+ f = self._get_unfiltered_back_frame(py_db, frame)
839
772
  if f is not None:
840
773
  info.pydev_step_stop = f
841
774
  else:
842
775
  info.pydev_step_cmd = 107
843
776
  info.pydev_step_stop = None
844
777
 
845
- elif event == 'exception':
778
+ elif event == "exception":
846
779
  breakpoints_for_file = None
847
780
  if has_exception_breakpoints:
848
- should_stop, frame = self._should_stop_on_exception(frame, event, arg)
781
+ should_stop, frame, exc_info = should_stop_on_exception(
782
+ self._args[0], self._args[2], frame, self._args[3], arg, self.exc_info
783
+ )
784
+ self.exc_info = exc_info
849
785
  if should_stop:
850
- if self._handle_exception(frame, event, arg, EXCEPTION_TYPE_HANDLED):
786
+ if handle_exception(self._args[0], self._args[3], frame, arg, EXCEPTION_TYPE_HANDLED):
851
787
  return self.trace_dispatch
852
788
 
853
789
  return self.trace_dispatch
@@ -856,13 +792,13 @@ cdef class PyDBFrame:
856
792
  return self.trace_dispatch
857
793
 
858
794
  else: # Not coroutine nor generator
859
- if event == 'line':
795
+ if event == "line":
860
796
  is_line = True
861
797
  is_call = False
862
798
  is_return = False
863
799
  is_exception_event = False
864
800
 
865
- elif event == 'return':
801
+ elif event == "return":
866
802
  is_line = False
867
803
  is_return = True
868
804
  is_call = False
@@ -875,11 +811,12 @@ cdef class PyDBFrame:
875
811
  # Note: this is especially troublesome when we're skipping code with the
876
812
  # @DontTrace comment.
877
813
  if (
878
- stop_frame is frame and
879
- not info.pydev_use_scoped_step_frame and is_return and
880
- step_cmd in (108, 109, 159, 160, 128)
881
- ):
882
-
814
+ stop_frame is frame
815
+ and not info.pydev_use_scoped_step_frame
816
+ and is_return
817
+ and step_cmd
818
+ in (108, 109, 159, 160, 128)
819
+ ):
883
820
  if step_cmd in (108, 109, 128):
884
821
  info.pydev_step_cmd = 107
885
822
  else:
@@ -890,21 +827,24 @@ cdef class PyDBFrame:
890
827
  if self.handle_user_exception(frame):
891
828
  return self.trace_dispatch
892
829
 
893
- elif event == 'call':
830
+ elif event == "call":
894
831
  is_line = False
895
832
  is_call = True
896
833
  is_return = False
897
834
  is_exception_event = False
898
835
  if frame.f_code.co_firstlineno == frame.f_lineno: # Check line to deal with async/await.
899
- function_breakpoint_on_call_event = main_debugger.function_breakpoint_name_to_breakpoint.get(frame.f_code.co_name)
836
+ function_breakpoint_on_call_event = py_db.function_breakpoint_name_to_breakpoint.get(frame.f_code.co_name)
900
837
 
901
- elif event == 'exception':
838
+ elif event == "exception":
902
839
  is_exception_event = True
903
840
  breakpoints_for_file = None
904
841
  if has_exception_breakpoints:
905
- should_stop, frame = self._should_stop_on_exception(frame, event, arg)
842
+ should_stop, frame, exc_info = should_stop_on_exception(
843
+ self._args[0], self._args[2], frame, self._args[3], arg, self.exc_info
844
+ )
845
+ self.exc_info = exc_info
906
846
  if should_stop:
907
- if self._handle_exception(frame, event, arg, EXCEPTION_TYPE_HANDLED):
847
+ if handle_exception(self._args[0], self._args[3], frame, arg, EXCEPTION_TYPE_HANDLED):
908
848
  return self.trace_dispatch
909
849
  is_line = False
910
850
  is_return = False
@@ -915,7 +855,7 @@ cdef class PyDBFrame:
915
855
  return self.trace_dispatch
916
856
 
917
857
  if not is_exception_event:
918
- breakpoints_for_file = main_debugger.breakpoints.get(abs_path_canonical_path_and_base[1])
858
+ breakpoints_for_file = py_db.breakpoints.get(abs_path_canonical_path_and_base[1])
919
859
 
920
860
  can_skip = False
921
861
 
@@ -927,22 +867,27 @@ cdef class PyDBFrame:
927
867
  if step_cmd == -1:
928
868
  can_skip = True
929
869
 
930
- elif step_cmd in (108, 109, 159, 160) and not self._is_same_frame(stop_frame, frame):
870
+ elif step_cmd in (
871
+ 108,
872
+ 109,
873
+ 159,
874
+ 160,
875
+ ) and not self._is_same_frame(stop_frame, frame):
931
876
  can_skip = True
932
877
 
933
878
  elif step_cmd == 128 and (
934
- stop_frame is not None and
935
- stop_frame is not frame and
936
- stop_frame is not frame.f_back and
937
- (frame.f_back is None or stop_frame is not frame.f_back.f_back)):
879
+ stop_frame is not None
880
+ and stop_frame is not frame
881
+ and stop_frame is not frame.f_back
882
+ and (frame.f_back is None or stop_frame is not frame.f_back.f_back)
883
+ ):
938
884
  can_skip = True
939
885
 
940
886
  elif step_cmd == 144:
941
- if (
942
- main_debugger.apply_files_filter(frame, frame.f_code.co_filename, True)
943
- and (frame.f_back is None or main_debugger.apply_files_filter(frame.f_back, frame.f_back.f_code.co_filename, True))
944
- ):
945
- can_skip = True
887
+ if py_db.apply_files_filter(frame, frame.f_code.co_filename, True) and (
888
+ frame.f_back is None or py_db.apply_files_filter(frame.f_back, frame.f_back.f_code.co_filename, True)
889
+ ):
890
+ can_skip = True
946
891
 
947
892
  elif step_cmd == 206:
948
893
  f = frame
@@ -954,11 +899,15 @@ cdef class PyDBFrame:
954
899
  can_skip = True
955
900
 
956
901
  if can_skip:
957
- if plugin_manager is not None and (
958
- main_debugger.has_plugin_line_breaks or main_debugger.has_plugin_exception_breaks):
959
- can_skip = plugin_manager.can_skip(main_debugger, frame)
902
+ if plugin_manager is not None and (py_db.has_plugin_line_breaks or py_db.has_plugin_exception_breaks):
903
+ can_skip = plugin_manager.can_skip(py_db, frame)
960
904
 
961
- if can_skip and main_debugger.show_return_values and info.pydev_step_cmd in (108, 159) and self._is_same_frame(stop_frame, frame.f_back):
905
+ if (
906
+ can_skip
907
+ and py_db.show_return_values
908
+ and info.pydev_step_cmd in (108, 159)
909
+ and self._is_same_frame(stop_frame, frame.f_back)
910
+ ):
962
911
  # trace function for showing return values after step over
963
912
  can_skip = False
964
913
 
@@ -1006,12 +955,12 @@ cdef class PyDBFrame:
1006
955
  curr_func_name = frame.f_code.co_name
1007
956
 
1008
957
  # global context is set with an empty name
1009
- if curr_func_name in ('?', '<module>', '<lambda>'):
1010
- curr_func_name = ''
958
+ if curr_func_name in ("?", "<module>", "<lambda>"):
959
+ curr_func_name = ""
1011
960
 
1012
961
  for bp in breakpoints_for_file.values():
1013
962
  # will match either global or some function
1014
- if bp.func_name in ('None', curr_func_name):
963
+ if bp.func_name in ("None", curr_func_name):
1015
964
  has_breakpoint_in_frame = True
1016
965
  break
1017
966
  else:
@@ -1057,26 +1006,29 @@ cdef class PyDBFrame:
1057
1006
  new_frame = frame
1058
1007
  stop = True
1059
1008
 
1060
- elif plugin_manager is not None and main_debugger.has_plugin_line_breaks:
1061
- result = plugin_manager.get_breakpoint(main_debugger, self, frame, event, self._args)
1009
+ elif plugin_manager is not None and py_db.has_plugin_line_breaks:
1010
+ result = plugin_manager.get_breakpoint(py_db, frame, event, self._args[2])
1062
1011
  if result:
1063
- stop_on_plugin_breakpoint, breakpoint, new_frame, bp_type = result
1012
+ stop_on_plugin_breakpoint = True
1013
+ breakpoint, new_frame, bp_type = result
1064
1014
 
1065
1015
  if breakpoint:
1066
1016
  # ok, hit breakpoint, now, we have to discover if it is a conditional breakpoint
1067
1017
  # lets do the conditional stuff here
1068
1018
  if breakpoint.expression is not None:
1069
- main_debugger.handle_breakpoint_expression(breakpoint, info, new_frame)
1019
+ py_db.handle_breakpoint_expression(breakpoint, info, new_frame)
1070
1020
 
1071
1021
  if stop or stop_on_plugin_breakpoint:
1072
1022
  eval_result = False
1073
1023
  if breakpoint.has_condition:
1074
- eval_result = main_debugger.handle_breakpoint_condition(info, breakpoint, new_frame)
1024
+ eval_result = py_db.handle_breakpoint_condition(info, breakpoint, new_frame)
1075
1025
  if not eval_result:
1076
1026
  stop = False
1077
1027
  stop_on_plugin_breakpoint = False
1078
1028
 
1079
- if is_call and (frame.f_code.co_name in ('<lambda>', '<module>') or (line == 1 and frame.f_code.co_name.startswith('<cell'))):
1029
+ if is_call and (
1030
+ frame.f_code.co_name in ("<lambda>", "<module>") or (line == 1 and frame.f_code.co_name.startswith("<cell"))
1031
+ ):
1080
1032
  # If we find a call for a module, it means that the module is being imported/executed for the
1081
1033
  # first time. In this case we have to ignore this hit as it may later duplicated by a
1082
1034
  # line event at the same place (so, if there's a module with a print() in the first line
@@ -1096,27 +1048,30 @@ cdef class PyDBFrame:
1096
1048
  stop_on_plugin_breakpoint = False
1097
1049
 
1098
1050
  if info.pydev_message is not None and len(info.pydev_message) > 0:
1099
- cmd = main_debugger.cmd_factory.make_io_message(info.pydev_message + os.linesep, '1')
1100
- main_debugger.writer.add_command(cmd)
1051
+ cmd = py_db.cmd_factory.make_io_message(info.pydev_message + os.linesep, "1")
1052
+ py_db.writer.add_command(cmd)
1101
1053
 
1102
- if main_debugger.show_return_values:
1054
+ if py_db.show_return_values:
1103
1055
  if is_return and (
1104
- (info.pydev_step_cmd in (108, 159, 128) and (self._is_same_frame(stop_frame, frame.f_back))) or
1105
- (info.pydev_step_cmd in (109, 160) and (self._is_same_frame(stop_frame, frame))) or
1106
- (info.pydev_step_cmd in (107, 206)) or
1107
- (
1108
- info.pydev_step_cmd == 144
1109
- and frame.f_back is not None
1110
- and not main_debugger.apply_files_filter(frame.f_back, frame.f_back.f_code.co_filename, True)
1111
- )
1112
- ):
1056
+ (
1057
+ info.pydev_step_cmd in (108, 159, 128)
1058
+ and (self._is_same_frame(stop_frame, frame.f_back))
1059
+ )
1060
+ or (info.pydev_step_cmd in (109, 160) and (self._is_same_frame(stop_frame, frame)))
1061
+ or (info.pydev_step_cmd in (107, 206))
1062
+ or (
1063
+ info.pydev_step_cmd == 144
1064
+ and frame.f_back is not None
1065
+ and not py_db.apply_files_filter(frame.f_back, frame.f_back.f_code.co_filename, True)
1066
+ )
1067
+ ):
1113
1068
  self._show_return_values(frame, arg)
1114
1069
 
1115
- elif main_debugger.remove_return_values_flag:
1070
+ elif py_db.remove_return_values_flag:
1116
1071
  try:
1117
- self._remove_return_values(main_debugger, frame)
1072
+ self._remove_return_values(py_db, frame)
1118
1073
  finally:
1119
- main_debugger.remove_return_values_flag = False
1074
+ py_db.remove_return_values_flag = False
1120
1075
 
1121
1076
  if stop:
1122
1077
  self.set_suspend(
@@ -1126,7 +1081,7 @@ cdef class PyDBFrame:
1126
1081
  )
1127
1082
 
1128
1083
  elif stop_on_plugin_breakpoint and plugin_manager is not None:
1129
- result = plugin_manager.suspend(main_debugger, thread, frame, bp_type)
1084
+ result = plugin_manager.suspend(py_db, thread, frame, bp_type)
1130
1085
  if result:
1131
1086
  frame = result
1132
1087
 
@@ -1143,9 +1098,14 @@ cdef class PyDBFrame:
1143
1098
  # Unfortunately Python itself stops the tracing when it originates from
1144
1099
  # the tracing function, so, we can't do much about it (just let the user know).
1145
1100
  exc = sys.exc_info()[0]
1146
- cmd = main_debugger.cmd_factory.make_console_message(
1147
- '%s raised from within the callback set in sys.settrace.\nDebugging will be disabled for this thread (%s).\n' % (exc, thread,))
1148
- main_debugger.writer.add_command(cmd)
1101
+ cmd = py_db.cmd_factory.make_console_message(
1102
+ "%s raised from within the callback set in sys.settrace.\nDebugging will be disabled for this thread (%s).\n"
1103
+ % (
1104
+ exc,
1105
+ thread,
1106
+ )
1107
+ )
1108
+ py_db.writer.add_command(cmd)
1149
1109
  if not issubclass(exc, (KeyboardInterrupt, SystemExit)):
1150
1110
  pydev_log.exception()
1151
1111
 
@@ -1159,7 +1119,7 @@ cdef class PyDBFrame:
1159
1119
  # I.e.: cache the result on self.should_skip (no need to evaluate the same frame multiple times).
1160
1120
  # Note that on a code reload, we won't re-evaluate this because in practice, the frame.f_code
1161
1121
  # Which will be handled by this frame is read-only, so, we can cache it safely.
1162
- if not pydevd_dont_trace.should_trace_hook(frame, abs_path_canonical_path_and_base[0]):
1122
+ if not pydevd_dont_trace.should_trace_hook(frame.f_code, abs_path_canonical_path_and_base[0]):
1163
1123
  # -1, 0, 1 to be Cython-friendly
1164
1124
  should_skip = self.should_skip = 1
1165
1125
  else:
@@ -1175,19 +1135,19 @@ cdef class PyDBFrame:
1175
1135
  force_check_project_scope = step_cmd == 144
1176
1136
  if is_line:
1177
1137
  if not info.pydev_use_scoped_step_frame:
1178
- if force_check_project_scope or main_debugger.is_files_filter_enabled:
1179
- stop = not main_debugger.apply_files_filter(frame, frame.f_code.co_filename, force_check_project_scope)
1138
+ if force_check_project_scope or py_db.is_files_filter_enabled:
1139
+ stop = not py_db.apply_files_filter(frame, frame.f_code.co_filename, force_check_project_scope)
1180
1140
  else:
1181
1141
  stop = True
1182
1142
  else:
1183
- if force_check_project_scope or main_debugger.is_files_filter_enabled:
1143
+ if force_check_project_scope or py_db.is_files_filter_enabled:
1184
1144
  # Make sure we check the filtering inside ipython calls too...
1185
- if not not main_debugger.apply_files_filter(frame, frame.f_code.co_filename, force_check_project_scope):
1145
+ if not not py_db.apply_files_filter(frame, frame.f_code.co_filename, force_check_project_scope):
1186
1146
  return None if is_call else NO_FTRACE
1187
1147
 
1188
1148
  # We can only stop inside the ipython call.
1189
1149
  filename = frame.f_code.co_filename
1190
- if filename.endswith('.pyc'):
1150
+ if filename.endswith(".pyc"):
1191
1151
  filename = filename[:-1]
1192
1152
 
1193
1153
  if not filename.endswith(PYDEVD_IPYTHON_CONTEXT[0]):
@@ -1196,7 +1156,7 @@ cdef class PyDBFrame:
1196
1156
  if f.f_code.co_name == PYDEVD_IPYTHON_CONTEXT[1]:
1197
1157
  f2 = f.f_back
1198
1158
  if f2 is not None and f2.f_code.co_name == PYDEVD_IPYTHON_CONTEXT[2]:
1199
- pydev_log.debug('Stop inside ipython call')
1159
+ pydev_log.debug("Stop inside ipython call")
1200
1160
  stop = True
1201
1161
  break
1202
1162
  f = f.f_back
@@ -1209,11 +1169,13 @@ cdef class PyDBFrame:
1209
1169
  return None if is_call else NO_FTRACE
1210
1170
 
1211
1171
  elif is_return and frame.f_back is not None and not info.pydev_use_scoped_step_frame:
1212
- if main_debugger.get_file_type(frame.f_back) == main_debugger.PYDEV_FILE:
1172
+ if py_db.get_file_type(frame.f_back) == py_db.PYDEV_FILE:
1213
1173
  stop = False
1214
1174
  else:
1215
- if force_check_project_scope or main_debugger.is_files_filter_enabled:
1216
- stop = not main_debugger.apply_files_filter(frame.f_back, frame.f_back.f_code.co_filename, force_check_project_scope)
1175
+ if force_check_project_scope or py_db.is_files_filter_enabled:
1176
+ stop = not py_db.apply_files_filter(
1177
+ frame.f_back, frame.f_back.f_code.co_filename, force_check_project_scope
1178
+ )
1217
1179
  if stop:
1218
1180
  # Prevent stopping in a return to the same location we were initially
1219
1181
  # (i.e.: double-stop at the same place due to some filtering).
@@ -1236,7 +1198,7 @@ cdef class PyDBFrame:
1236
1198
  stop = False
1237
1199
 
1238
1200
  if plugin_manager is not None:
1239
- result = plugin_manager.cmd_step_into(main_debugger, frame, event, self._args, stop_info, stop)
1201
+ result = plugin_manager.cmd_step_into(py_db, frame, event, self._args[2], self._args[3], stop_info, stop)
1240
1202
  if result:
1241
1203
  stop, plugin_stop = result
1242
1204
 
@@ -1249,7 +1211,7 @@ cdef class PyDBFrame:
1249
1211
  # i.e.: don't stop in: (stop_frame is frame.f_back and is_return) as we'd stop twice in that line.
1250
1212
 
1251
1213
  if plugin_manager is not None:
1252
- result = plugin_manager.cmd_step_over(main_debugger, frame, event, self._args, stop_info, stop)
1214
+ result = plugin_manager.cmd_step_over(py_db, frame, event, self._args[2], self._args[3], stop_info, stop)
1253
1215
  if result:
1254
1216
  stop, plugin_stop = result
1255
1217
 
@@ -1273,16 +1235,19 @@ cdef class PyDBFrame:
1273
1235
  if pydev_smart_parent_offset >= 0 and pydev_smart_step_into_variants:
1274
1236
  # Preferred mode (when the smart step into variants are available
1275
1237
  # and the offset is set).
1276
- stop = get_smart_step_into_variant_from_frame_offset(back.f_lasti, pydev_smart_step_into_variants) is \
1277
- get_smart_step_into_variant_from_frame_offset(pydev_smart_parent_offset, pydev_smart_step_into_variants)
1238
+ stop = get_smart_step_into_variant_from_frame_offset(
1239
+ back.f_lasti, pydev_smart_step_into_variants
1240
+ ) is get_smart_step_into_variant_from_frame_offset(
1241
+ pydev_smart_parent_offset, pydev_smart_step_into_variants
1242
+ )
1278
1243
 
1279
1244
  else:
1280
1245
  # Only the name/line is available, so, check that.
1281
1246
  curr_func_name = frame.f_code.co_name
1282
1247
 
1283
1248
  # global context is set with an empty name
1284
- if curr_func_name in ('?', '<module>') or curr_func_name is None:
1285
- curr_func_name = ''
1249
+ if curr_func_name in ("?", "<module>") or curr_func_name is None:
1250
+ curr_func_name = ""
1286
1251
  if curr_func_name == info.pydev_func_name and stop_frame.f_lineno == info.pydev_next_line:
1287
1252
  stop = True
1288
1253
 
@@ -1309,13 +1274,15 @@ cdef class PyDBFrame:
1309
1274
  # the child (because this is a generator, the parent may have moved forward
1310
1275
  # already -- and that's ok, so, we just check that the parent frame
1311
1276
  # matches in this case).
1312
- smart_step_into_variant = get_smart_step_into_variant_from_frame_offset(pydev_smart_parent_offset, pydev_smart_step_into_variants)
1277
+ smart_step_into_variant = get_smart_step_into_variant_from_frame_offset(
1278
+ pydev_smart_parent_offset, pydev_smart_step_into_variants
1279
+ )
1313
1280
  # print('matched parent offset', pydev_smart_parent_offset)
1314
1281
  # Ok, now, check the child variant
1315
1282
  children_variants = smart_step_into_variant.children_variants
1316
1283
  stop = children_variants and (
1317
- get_smart_step_into_variant_from_frame_offset(back.f_lasti, children_variants) is \
1318
- get_smart_step_into_variant_from_frame_offset(pydev_smart_child_offset, children_variants)
1284
+ get_smart_step_into_variant_from_frame_offset(back.f_lasti, children_variants)
1285
+ is get_smart_step_into_variant_from_frame_offset(pydev_smart_child_offset, children_variants)
1319
1286
  )
1320
1287
  # print('stop at child', stop)
1321
1288
 
@@ -1331,13 +1298,13 @@ cdef class PyDBFrame:
1331
1298
  stop = False
1332
1299
 
1333
1300
  if stop and step_cmd != -1 and is_return and hasattr(frame, "f_back"):
1334
- f_code = getattr(frame.f_back, 'f_code', None)
1301
+ f_code = getattr(frame.f_back, "f_code", None)
1335
1302
  if f_code is not None:
1336
- if main_debugger.get_file_type(frame.f_back) == main_debugger.PYDEV_FILE:
1303
+ if py_db.get_file_type(frame.f_back) == py_db.PYDEV_FILE:
1337
1304
  stop = False
1338
1305
 
1339
1306
  if plugin_stop:
1340
- stopped_on_plugin = plugin_manager.stop(main_debugger, frame, event, self._args, stop_info, arg, step_cmd)
1307
+ plugin_manager.stop(py_db, frame, event, self._args[3], stop_info, arg, step_cmd)
1341
1308
  elif stop:
1342
1309
  if is_line:
1343
1310
  self.set_suspend(thread, step_cmd, original_step_cmd=info.pydev_original_step_cmd)
@@ -1358,13 +1325,13 @@ cdef class PyDBFrame:
1358
1325
  return None if is_call else NO_FTRACE
1359
1326
 
1360
1327
  elif pydevd_dont_trace.should_trace_hook is not None:
1361
- if not pydevd_dont_trace.should_trace_hook(back, back_absolute_filename):
1328
+ if not pydevd_dont_trace.should_trace_hook(back.f_code, back_absolute_filename):
1362
1329
  # In this case, we'll have to skip the previous one because it shouldn't be traced.
1363
1330
  # Also, we have to reset the tracing, because if the parent's parent (or some
1364
1331
  # other parent) has to be traced and it's not currently, we wouldn't stop where
1365
1332
  # we should anymore (so, a step in/over/return may not stop anywhere if no parent is traced).
1366
1333
  # Related test: _debugger_case17a.py
1367
- main_debugger.set_trace_for_frame_and_parents(back)
1334
+ py_db.set_trace_for_frame_and_parents(thread.ident, back)
1368
1335
  return None if is_call else NO_FTRACE
1369
1336
 
1370
1337
  if back is not None:
@@ -1377,9 +1344,10 @@ cdef class PyDBFrame:
1377
1344
  info.pydev_original_step_cmd = -1
1378
1345
  info.pydev_step_cmd = -1
1379
1346
  info.pydev_state = 1
1347
+ info.update_stepping_info()
1380
1348
 
1381
1349
  # if we are quitting, let's stop the tracing
1382
- if main_debugger.quitting:
1350
+ if py_db.quitting:
1383
1351
  return None if is_call else NO_FTRACE
1384
1352
 
1385
1353
  return self.trace_dispatch
@@ -1387,9 +1355,14 @@ cdef class PyDBFrame:
1387
1355
  # Unfortunately Python itself stops the tracing when it originates from
1388
1356
  # the tracing function, so, we can't do much about it (just let the user know).
1389
1357
  exc = sys.exc_info()[0]
1390
- cmd = main_debugger.cmd_factory.make_console_message(
1391
- '%s raised from within the callback set in sys.settrace.\nDebugging will be disabled for this thread (%s).\n' % (exc, thread,))
1392
- main_debugger.writer.add_command(cmd)
1358
+ cmd = py_db.cmd_factory.make_console_message(
1359
+ "%s raised from within the callback set in sys.settrace.\nDebugging will be disabled for this thread (%s).\n"
1360
+ % (
1361
+ exc,
1362
+ thread,
1363
+ )
1364
+ )
1365
+ py_db.writer.add_command(cmd)
1393
1366
  if not issubclass(exc, (KeyboardInterrupt, SystemExit)):
1394
1367
  pydev_log.exception()
1395
1368
  raise
@@ -1398,20 +1371,284 @@ cdef class PyDBFrame:
1398
1371
  info.is_tracing -= 1
1399
1372
 
1400
1373
  # end trace_dispatch
1374
+
1375
+
1376
+ # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1377
+ def should_stop_on_exception(py_db, PyDBAdditionalThreadInfo info, frame, thread, arg, prev_user_uncaught_exc_info):
1378
+ cdef bint should_stop;
1379
+ cdef bint was_just_raised;
1380
+ cdef list check_excs;
1381
+ # ELSE
1382
+ # def should_stop_on_exception(py_db, info, frame, thread, arg, prev_user_uncaught_exc_info):
1383
+ # ENDIF
1384
+
1385
+ should_stop = False
1386
+ maybe_user_uncaught_exc_info = prev_user_uncaught_exc_info
1387
+
1388
+ # 2 = 2
1389
+ if info.pydev_state != 2: # and breakpoint is not None:
1390
+ exception, value, trace = arg
1391
+
1392
+ if trace is not None and hasattr(trace, "tb_next"):
1393
+ # on jython trace is None on the first event and it may not have a tb_next.
1394
+
1395
+ should_stop = False
1396
+ exception_breakpoint = None
1397
+ try:
1398
+ if py_db.plugin is not None:
1399
+ result = py_db.plugin.exception_break(py_db, frame, thread, arg)
1400
+ if result:
1401
+ should_stop, frame = result
1402
+ except:
1403
+ pydev_log.exception()
1404
+
1405
+ if not should_stop:
1406
+ # Apply checks that don't need the exception breakpoint (where we shouldn't ever stop).
1407
+ if exception == SystemExit and py_db.ignore_system_exit_code(value):
1408
+ pass
1409
+
1410
+ elif exception in (GeneratorExit, StopIteration, StopAsyncIteration):
1411
+ # These exceptions are control-flow related (they work as a generator
1412
+ # pause), so, we shouldn't stop on them.
1413
+ pass
1414
+
1415
+ elif ignore_exception_trace(trace):
1416
+ pass
1417
+
1418
+ else:
1419
+ was_just_raised = just_raised(trace)
1420
+
1421
+ # It was not handled by any plugin, lets check exception breakpoints.
1422
+ check_excs = []
1423
+
1424
+ # Note: check user unhandled before regular exceptions.
1425
+ exc_break_user = py_db.get_exception_breakpoint(exception, py_db.break_on_user_uncaught_exceptions)
1426
+ if exc_break_user is not None:
1427
+ check_excs.append((exc_break_user, True))
1428
+
1429
+ exc_break_caught = py_db.get_exception_breakpoint(exception, py_db.break_on_caught_exceptions)
1430
+ if exc_break_caught is not None:
1431
+ check_excs.append((exc_break_caught, False))
1432
+
1433
+ for exc_break, is_user_uncaught in check_excs:
1434
+ # Initially mark that it should stop and then go into exclusions.
1435
+ should_stop = True
1436
+
1437
+ if py_db.exclude_exception_by_filter(exc_break, trace):
1438
+ pydev_log.debug(
1439
+ "Ignore exception %s in library %s -- (%s)" % (exception, frame.f_code.co_filename, frame.f_code.co_name)
1440
+ )
1441
+ should_stop = False
1442
+
1443
+ elif exc_break.condition is not None and not py_db.handle_breakpoint_condition(info, exc_break, frame):
1444
+ should_stop = False
1445
+
1446
+ elif is_user_uncaught:
1447
+ # Note: we don't stop here, we just collect the exc_info to use later on...
1448
+ should_stop = False
1449
+ if not py_db.apply_files_filter(frame, frame.f_code.co_filename, True) and (
1450
+ frame.f_back is None or py_db.apply_files_filter(frame.f_back, frame.f_back.f_code.co_filename, True)
1451
+ ):
1452
+ # User uncaught means that we're currently in user code but the code
1453
+ # up the stack is library code.
1454
+ exc_info = prev_user_uncaught_exc_info
1455
+ if not exc_info:
1456
+ exc_info = (arg, frame.f_lineno, set([frame.f_lineno]))
1457
+ else:
1458
+ lines = exc_info[2]
1459
+ lines.add(frame.f_lineno)
1460
+ exc_info = (arg, frame.f_lineno, lines)
1461
+ maybe_user_uncaught_exc_info = exc_info
1462
+ else:
1463
+ # I.e.: these are only checked if we're not dealing with user uncaught exceptions.
1464
+ if (
1465
+ exc_break.notify_on_first_raise_only
1466
+ and py_db.skip_on_exceptions_thrown_in_same_context
1467
+ and not was_just_raised
1468
+ and not just_raised(trace.tb_next)
1469
+ ):
1470
+ # In this case we never stop if it was just raised, so, to know if it was the first we
1471
+ # need to check if we're in the 2nd method.
1472
+ should_stop = False # I.e.: we stop only when we're at the caller of a method that throws an exception
1473
+
1474
+ elif (
1475
+ exc_break.notify_on_first_raise_only
1476
+ and not py_db.skip_on_exceptions_thrown_in_same_context
1477
+ and not was_just_raised
1478
+ ):
1479
+ should_stop = False # I.e.: we stop only when it was just raised
1480
+
1481
+ elif was_just_raised and py_db.skip_on_exceptions_thrown_in_same_context:
1482
+ # Option: Don't break if an exception is caught in the same function from which it is thrown
1483
+ should_stop = False
1484
+
1485
+ if should_stop:
1486
+ exception_breakpoint = exc_break
1487
+ try:
1488
+ info.pydev_message = exc_break.qname
1489
+ except:
1490
+ info.pydev_message = exc_break.qname.encode("utf-8")
1491
+ break
1492
+
1493
+ if should_stop:
1494
+ # Always add exception to frame (must remove later after we proceed).
1495
+ add_exception_to_frame(frame, (exception, value, trace))
1496
+
1497
+ if exception_breakpoint is not None and exception_breakpoint.expression is not None:
1498
+ py_db.handle_breakpoint_expression(exception_breakpoint, info, frame)
1499
+
1500
+ return should_stop, frame, maybe_user_uncaught_exc_info
1501
+
1502
+
1503
+ # Same thing in the main debugger but only considering the file contents, while the one in the main debugger
1504
+ # considers the user input (so, the actual result must be a join of both).
1505
+ filename_to_lines_where_exceptions_are_ignored: dict = {}
1506
+ filename_to_stat_info: dict = {}
1507
+
1508
+
1509
+ # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1510
+ def handle_exception(py_db, thread, frame, arg, str exception_type):
1511
+ cdef bint stopped;
1512
+ cdef tuple abs_real_path_and_base;
1513
+ cdef str absolute_filename;
1514
+ cdef str canonical_normalized_filename;
1515
+ cdef dict lines_ignored;
1516
+ cdef dict frame_id_to_frame;
1517
+ cdef dict merged;
1518
+ cdef object trace_obj;
1519
+ # ELSE
1520
+ # def handle_exception(py_db, thread, frame, arg, exception_type):
1521
+ # ENDIF
1522
+ stopped = False
1523
+ try:
1524
+ # print('handle_exception', frame.f_lineno, frame.f_code.co_name)
1525
+
1526
+ # We have 3 things in arg: exception type, description, traceback object
1527
+ trace_obj = arg[2]
1528
+
1529
+ initial_trace_obj = trace_obj
1530
+ if trace_obj.tb_next is None and trace_obj.tb_frame is frame:
1531
+ # I.e.: tb_next should be only None in the context it was thrown (trace_obj.tb_frame is frame is just a double check).
1532
+ pass
1533
+ else:
1534
+ # Get the trace_obj from where the exception was raised...
1535
+ while trace_obj.tb_next is not None:
1536
+ trace_obj = trace_obj.tb_next
1537
+
1538
+ if py_db.ignore_exceptions_thrown_in_lines_with_ignore_exception:
1539
+ for check_trace_obj in (initial_trace_obj, trace_obj):
1540
+ abs_real_path_and_base = get_abs_path_real_path_and_base_from_frame(check_trace_obj.tb_frame)
1541
+ absolute_filename = abs_real_path_and_base[0]
1542
+ canonical_normalized_filename = abs_real_path_and_base[1]
1543
+
1544
+ lines_ignored = filename_to_lines_where_exceptions_are_ignored.get(canonical_normalized_filename)
1545
+ if lines_ignored is None:
1546
+ lines_ignored = filename_to_lines_where_exceptions_are_ignored[canonical_normalized_filename] = {}
1547
+
1548
+ try:
1549
+ curr_stat = os.stat(absolute_filename)
1550
+ curr_stat = (curr_stat.st_size, curr_stat.st_mtime)
1551
+ except:
1552
+ curr_stat = None
1553
+
1554
+ last_stat = filename_to_stat_info.get(absolute_filename)
1555
+ if last_stat != curr_stat:
1556
+ filename_to_stat_info[absolute_filename] = curr_stat
1557
+ lines_ignored.clear()
1558
+ try:
1559
+ linecache.checkcache(absolute_filename)
1560
+ except:
1561
+ pydev_log.exception("Error in linecache.checkcache(%r)", absolute_filename)
1562
+
1563
+ from_user_input = py_db.filename_to_lines_where_exceptions_are_ignored.get(canonical_normalized_filename)
1564
+ if from_user_input:
1565
+ merged = {}
1566
+ merged.update(lines_ignored)
1567
+ # Override what we have with the related entries that the user entered
1568
+ merged.update(from_user_input)
1569
+ else:
1570
+ merged = lines_ignored
1571
+
1572
+ exc_lineno = check_trace_obj.tb_lineno
1573
+
1574
+ # print ('lines ignored', lines_ignored)
1575
+ # print ('user input', from_user_input)
1576
+ # print ('merged', merged, 'curr', exc_lineno)
1577
+
1578
+ if exc_lineno not in merged: # Note: check on merged but update lines_ignored.
1579
+ try:
1580
+ line = linecache.getline(absolute_filename, exc_lineno, check_trace_obj.tb_frame.f_globals)
1581
+ except:
1582
+ pydev_log.exception("Error in linecache.getline(%r, %s, f_globals)", absolute_filename, exc_lineno)
1583
+ line = ""
1584
+
1585
+ if IGNORE_EXCEPTION_TAG.match(line) is not None:
1586
+ lines_ignored[exc_lineno] = 1
1587
+ return False
1588
+ else:
1589
+ # Put in the cache saying not to ignore
1590
+ lines_ignored[exc_lineno] = 0
1591
+ else:
1592
+ # Ok, dict has it already cached, so, let's check it...
1593
+ if merged.get(exc_lineno, 0):
1594
+ return False
1595
+
1596
+ try:
1597
+ frame_id_to_frame = {}
1598
+ frame_id_to_frame[id(frame)] = frame
1599
+ f = trace_obj.tb_frame
1600
+ while f is not None:
1601
+ frame_id_to_frame[id(f)] = f
1602
+ f = f.f_back
1603
+ f = None
1604
+
1605
+ stopped = True
1606
+ py_db.send_caught_exception_stack(thread, arg, id(frame))
1607
+ try:
1608
+ py_db.set_suspend(thread, 137)
1609
+ py_db.do_wait_suspend(thread, frame, "exception", arg, exception_type=exception_type)
1610
+ finally:
1611
+ py_db.send_caught_exception_stack_proceeded(thread)
1612
+ except:
1613
+ pydev_log.exception()
1614
+
1615
+ py_db.set_trace_for_frame_and_parents(thread.ident, frame)
1616
+ finally:
1617
+ # Make sure the user cannot see the '__exception__' we added after we leave the suspend state.
1618
+ remove_exception_from_frame(frame)
1619
+ # Clear some local variables...
1620
+ frame = None
1621
+ trace_obj = None
1622
+ initial_trace_obj = None
1623
+ check_trace_obj = None
1624
+ f = None
1625
+ frame_id_to_frame = None
1626
+ py_db = None
1627
+ thread = None
1628
+
1629
+ return stopped
1401
1630
  from _pydev_bundle.pydev_is_thread_alive import is_thread_alive
1402
1631
  from _pydev_bundle.pydev_log import exception as pydev_log_exception
1403
1632
  from _pydev_bundle._pydev_saved_modules import threading
1404
- from _pydevd_bundle.pydevd_constants import (get_current_thread_id, NO_FTRACE,
1405
- USE_CUSTOM_SYS_CURRENT_FRAMES_MAP, ForkSafeLock)
1633
+ from _pydevd_bundle.pydevd_constants import (
1634
+ get_current_thread_id,
1635
+ NO_FTRACE,
1636
+ USE_CUSTOM_SYS_CURRENT_FRAMES_MAP,
1637
+ ForkSafeLock,
1638
+ PYDEVD_USE_SYS_MONITORING,
1639
+ )
1406
1640
  from pydevd_file_utils import get_abs_path_real_path_and_base_from_frame, NORM_PATHS_AND_BASE_CONTAINER
1407
1641
 
1642
+ # fmt: off
1408
1643
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1409
1644
  from cpython.object cimport PyObject
1410
1645
  from cpython.ref cimport Py_INCREF, Py_XDECREF
1411
1646
  # ELSE
1412
1647
  # from _pydevd_bundle.pydevd_frame import PyDBFrame, is_unhandled_exception
1413
1648
  # ENDIF
1649
+ # fmt: on
1414
1650
 
1651
+ # fmt: off
1415
1652
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1416
1653
  cdef dict _global_notify_skipped_step_in
1417
1654
  # ELSE
@@ -1421,6 +1658,7 @@ cdef dict _global_notify_skipped_step_in
1421
1658
  # 109 = 109
1422
1659
  # 160 = 160
1423
1660
  # ENDIF
1661
+ # fmt: on
1424
1662
 
1425
1663
  # Cache where we should keep that we completely skipped entering some context.
1426
1664
  # It needs to be invalidated when:
@@ -1444,6 +1682,8 @@ def notify_skipped_step_in_because_of_filters(py_db, frame):
1444
1682
  _global_notify_skipped_step_in = True
1445
1683
  py_db.notify_skipped_step_in_because_of_filters(frame)
1446
1684
 
1685
+
1686
+ # fmt: off
1447
1687
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1448
1688
  cdef class SafeCallWrapper:
1449
1689
  cdef method_object
@@ -1461,14 +1701,17 @@ cdef class SafeCallWrapper:
1461
1701
  return self.method_object
1462
1702
  # ELSE
1463
1703
  # ENDIF
1704
+ # fmt: on
1464
1705
 
1465
1706
 
1466
1707
  def fix_top_level_trace_and_get_trace_func(py_db, frame):
1708
+ # fmt: off
1467
1709
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1468
1710
  cdef str filename;
1469
1711
  cdef str name;
1470
1712
  cdef tuple args;
1471
1713
  # ENDIF
1714
+ # fmt: on
1472
1715
 
1473
1716
  # Note: this is always the first entry-point in the tracing for any thread.
1474
1717
  # After entering here we'll set a new tracing function for this thread
@@ -1486,45 +1729,45 @@ def fix_top_level_trace_and_get_trace_func(py_db, frame):
1486
1729
 
1487
1730
  name = f_unhandled.f_code.co_filename
1488
1731
  # basename
1489
- i = name.rfind('/')
1490
- j = name.rfind('\\')
1732
+ i = name.rfind("/")
1733
+ j = name.rfind("\\")
1491
1734
  if j > i:
1492
1735
  i = j
1493
1736
  if i >= 0:
1494
- name = name[i + 1:]
1737
+ name = name[i + 1 :]
1495
1738
  # remove ext
1496
- i = name.rfind('.')
1739
+ i = name.rfind(".")
1497
1740
  if i >= 0:
1498
1741
  name = name[:i]
1499
1742
 
1500
- if name == 'threading':
1501
- if f_unhandled.f_code.co_name in ('__bootstrap', '_bootstrap'):
1743
+ if name == "threading":
1744
+ if f_unhandled.f_code.co_name in ("__bootstrap", "_bootstrap"):
1502
1745
  # We need __bootstrap_inner, not __bootstrap.
1503
1746
  return None, False
1504
1747
 
1505
- elif f_unhandled.f_code.co_name in ('__bootstrap_inner', '_bootstrap_inner'):
1748
+ elif f_unhandled.f_code.co_name in ("__bootstrap_inner", "_bootstrap_inner"):
1506
1749
  # Note: be careful not to use threading.currentThread to avoid creating a dummy thread.
1507
- t = f_unhandled.f_locals.get('self')
1750
+ t = f_unhandled.f_locals.get("self")
1508
1751
  force_only_unhandled_tracer = True
1509
1752
  if t is not None and isinstance(t, threading.Thread):
1510
1753
  thread = t
1511
1754
  break
1512
1755
 
1513
- elif name == 'pydev_monkey':
1514
- if f_unhandled.f_code.co_name == '__call__':
1756
+ elif name == "pydev_monkey":
1757
+ if f_unhandled.f_code.co_name == "__call__":
1515
1758
  force_only_unhandled_tracer = True
1516
1759
  break
1517
1760
 
1518
- elif name == 'pydevd':
1519
- if f_unhandled.f_code.co_name in ('run', 'main'):
1761
+ elif name == "pydevd":
1762
+ if f_unhandled.f_code.co_name in ("run", "main"):
1520
1763
  # We need to get to _exec
1521
1764
  return None, False
1522
1765
 
1523
- if f_unhandled.f_code.co_name == '_exec':
1766
+ if f_unhandled.f_code.co_name == "_exec":
1524
1767
  force_only_unhandled_tracer = True
1525
1768
  break
1526
1769
 
1527
- elif name == 'pydevd_tracing':
1770
+ elif name == "pydevd_tracing":
1528
1771
  return None, False
1529
1772
 
1530
1773
  elif f_unhandled.f_back is None:
@@ -1543,7 +1786,7 @@ def fix_top_level_trace_and_get_trace_func(py_db, frame):
1543
1786
  # Jython does not have threading.get_ident().
1544
1787
  thread = py_db.threading_current_thread()
1545
1788
 
1546
- if getattr(thread, 'pydev_do_not_trace', None):
1789
+ if getattr(thread, "pydev_do_not_trace", None):
1547
1790
  py_db.disable_tracing()
1548
1791
  return None, False
1549
1792
 
@@ -1561,19 +1804,25 @@ def fix_top_level_trace_and_get_trace_func(py_db, frame):
1561
1804
  if f_unhandled.f_back is None and not force_only_unhandled_tracer:
1562
1805
  # Happens when we attach to a running program (cannot reuse instance because it's mutable).
1563
1806
  top_level_thread_tracer = TopLevelThreadTracerNoBackFrame(ThreadTracer(args), args)
1564
- additional_info.top_level_thread_tracer_no_back_frames.append(top_level_thread_tracer) # Hack for cython to keep it alive while the thread is alive (just the method in the SetTrace is not enough).
1807
+ additional_info.top_level_thread_tracer_no_back_frames.append(
1808
+ top_level_thread_tracer
1809
+ ) # Hack for cython to keep it alive while the thread is alive (just the method in the SetTrace is not enough).
1565
1810
  else:
1566
1811
  top_level_thread_tracer = additional_info.top_level_thread_tracer_unhandled
1567
1812
  if top_level_thread_tracer is None:
1568
1813
  # Stop in some internal place to report about unhandled exceptions
1569
1814
  top_level_thread_tracer = TopLevelThreadTracerOnlyUnhandledExceptions(args)
1570
- additional_info.top_level_thread_tracer_unhandled = top_level_thread_tracer # Hack for cython to keep it alive while the thread is alive (just the method in the SetTrace is not enough).
1815
+ additional_info.top_level_thread_tracer_unhandled = (
1816
+ top_level_thread_tracer
1817
+ ) # Hack for cython to keep it alive while the thread is alive (just the method in the SetTrace is not enough).
1571
1818
 
1572
1819
  # print(' --> found to trace unhandled', f_unhandled.f_code.co_name, f_unhandled.f_code.co_filename, f_unhandled.f_code.co_firstlineno)
1573
1820
  f_trace = top_level_thread_tracer.get_trace_dispatch_func()
1821
+ # fmt: off
1574
1822
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1575
1823
  f_trace = SafeCallWrapper(f_trace)
1576
1824
  # ENDIF
1825
+ # fmt: on
1577
1826
  f_unhandled.f_trace = f_trace
1578
1827
 
1579
1828
  if frame is f_unhandled:
@@ -1584,22 +1833,25 @@ def fix_top_level_trace_and_get_trace_func(py_db, frame):
1584
1833
  thread_tracer = ThreadTracer(args)
1585
1834
  additional_info.thread_tracer = thread_tracer
1586
1835
 
1587
- # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1836
+ # fmt: off
1837
+ # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1588
1838
  return SafeCallWrapper(thread_tracer), True
1589
- # ELSE
1839
+ # ELSE
1590
1840
  # return thread_tracer, True
1591
- # ENDIF
1841
+ # ENDIF
1842
+ # fmt: on
1592
1843
 
1593
1844
 
1594
1845
  def trace_dispatch(py_db, frame, event, arg):
1595
1846
  thread_trace_func, apply_to_settrace = py_db.fix_top_level_trace_and_get_trace_func(py_db, frame)
1596
1847
  if thread_trace_func is None:
1597
- return None if event == 'call' else NO_FTRACE
1848
+ return None if event == "call" else NO_FTRACE
1598
1849
  if apply_to_settrace:
1599
1850
  py_db.enable_tracing(thread_trace_func)
1600
1851
  return thread_trace_func(frame, event, arg)
1601
1852
 
1602
1853
 
1854
+ # fmt: off
1603
1855
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1604
1856
  cdef class TopLevelThreadTracerOnlyUnhandledExceptions:
1605
1857
  cdef public tuple _args;
@@ -1607,15 +1859,16 @@ cdef class TopLevelThreadTracerOnlyUnhandledExceptions:
1607
1859
  self._args = args
1608
1860
  # ELSE
1609
1861
  # class TopLevelThreadTracerOnlyUnhandledExceptions(object):
1610
- #
1611
1862
  # def __init__(self, args):
1612
1863
  # self._args = args
1864
+ #
1613
1865
  # ENDIF
1866
+ # fmt: on
1614
1867
 
1615
1868
  def trace_unhandled_exceptions(self, frame, event, arg):
1616
1869
  # Note that we ignore the frame as this tracing method should only be put in topmost frames already.
1617
1870
  # print('trace_unhandled_exceptions', event, frame.f_code.co_name, frame.f_code.co_filename, frame.f_code.co_firstlineno)
1618
- if event == 'exception' and arg is not None:
1871
+ if event == "exception" and arg is not None:
1619
1872
  py_db, t, additional_info = self._args[0:3]
1620
1873
  if arg is not None:
1621
1874
  if not additional_info.suspended_at_unhandled:
@@ -1629,7 +1882,7 @@ cdef class TopLevelThreadTracerOnlyUnhandledExceptions:
1629
1882
  def get_trace_dispatch_func(self):
1630
1883
  return self.trace_unhandled_exceptions
1631
1884
 
1632
-
1885
+ # fmt: off
1633
1886
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1634
1887
  cdef class TopLevelThreadTracerNoBackFrame:
1635
1888
  cdef public object _frame_trace_dispatch;
@@ -1647,7 +1900,7 @@ cdef class TopLevelThreadTracerNoBackFrame:
1647
1900
  self._last_raise_line = -1
1648
1901
  # ELSE
1649
1902
  # class TopLevelThreadTracerNoBackFrame(object):
1650
- # '''
1903
+ # """
1651
1904
  # This tracer is pretty special in that it's dealing with a frame without f_back (i.e.: top frame
1652
1905
  # on remote attach or QThread).
1653
1906
  #
@@ -1657,7 +1910,7 @@ cdef class TopLevelThreadTracerNoBackFrame:
1657
1910
  # work with in the tracing -- see: https://bugs.python.org/issue34099, so, we inspect bytecode to
1658
1911
  # determine if some exception will be traced or not... note that if this is not available -- such
1659
1912
  # as on Jython -- we consider any top-level exception to be unnhandled).
1660
- # '''
1913
+ # """
1661
1914
  #
1662
1915
  # def __init__(self, frame_trace_dispatch, args):
1663
1916
  # self._frame_trace_dispatch = frame_trace_dispatch
@@ -1666,7 +1919,9 @@ cdef class TopLevelThreadTracerNoBackFrame:
1666
1919
  # self._last_exc_arg = None
1667
1920
  # self._raise_lines = set()
1668
1921
  # self._last_raise_line = -1
1922
+ #
1669
1923
  # ENDIF
1924
+ # fmt: on
1670
1925
 
1671
1926
  def trace_dispatch_and_unhandled_exceptions(self, frame, event, arg):
1672
1927
  # DEBUG = 'code_to_debug' in frame.f_code.co_filename
@@ -1675,12 +1930,12 @@ cdef class TopLevelThreadTracerNoBackFrame:
1675
1930
  if frame_trace_dispatch is not None:
1676
1931
  self._frame_trace_dispatch = frame_trace_dispatch(frame, event, arg)
1677
1932
 
1678
- if event == 'exception':
1933
+ if event == "exception":
1679
1934
  self._last_exc_arg = arg
1680
1935
  self._raise_lines.add(frame.f_lineno)
1681
1936
  self._last_raise_line = frame.f_lineno
1682
1937
 
1683
- elif event == 'return' and self._last_exc_arg is not None:
1938
+ elif event == "return" and self._last_exc_arg is not None:
1684
1939
  # For unhandled exceptions we actually track the return when at the topmost level.
1685
1940
  try:
1686
1941
  py_db, t, additional_info = self._args[0:3]
@@ -1694,17 +1949,20 @@ cdef class TopLevelThreadTracerNoBackFrame:
1694
1949
  ret = self.trace_dispatch_and_unhandled_exceptions
1695
1950
 
1696
1951
  # Need to reset (the call to _frame_trace_dispatch may have changed it).
1952
+ # fmt: off
1697
1953
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1698
1954
  frame.f_trace = SafeCallWrapper(ret)
1699
1955
  # ELSE
1700
1956
  # frame.f_trace = ret
1701
1957
  # ENDIF
1958
+ # fmt: on
1702
1959
  return ret
1703
1960
 
1704
1961
  def get_trace_dispatch_func(self):
1705
1962
  return self.trace_dispatch_and_unhandled_exceptions
1706
1963
 
1707
1964
 
1965
+ # fmt: off
1708
1966
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1709
1967
  cdef class ThreadTracer:
1710
1968
  cdef public tuple _args;
@@ -1712,13 +1970,14 @@ cdef class ThreadTracer:
1712
1970
  self._args = args
1713
1971
  # ELSE
1714
1972
  # class ThreadTracer(object):
1715
- #
1716
1973
  # def __init__(self, args):
1717
1974
  # self._args = args
1975
+ #
1718
1976
  # ENDIF
1977
+ # fmt: on
1719
1978
 
1720
1979
  def __call__(self, frame, event, arg):
1721
- ''' This is the callback used when we enter some context in the debugger.
1980
+ """This is the callback used when we enter some context in the debugger.
1722
1981
 
1723
1982
  We also decorate the thread we are in with info about the debugging.
1724
1983
  The attributes added are:
@@ -1729,7 +1988,8 @@ cdef class ThreadTracer:
1729
1988
 
1730
1989
  :param PyDB py_db:
1731
1990
  This is the global debugger (this method should actually be added as a method to it).
1732
- '''
1991
+ """
1992
+ # fmt: off
1733
1993
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1734
1994
  cdef str filename;
1735
1995
  cdef str base;
@@ -1740,24 +2000,25 @@ cdef class ThreadTracer:
1740
2000
  cdef tuple abs_path_canonical_path_and_base;
1741
2001
  cdef PyDBAdditionalThreadInfo additional_info;
1742
2002
  # ENDIF
2003
+ # fmt: on
1743
2004
 
1744
2005
  # DEBUG = 'code_to_debug' in frame.f_code.co_filename
1745
2006
  # if DEBUG: print('ENTER: trace_dispatch: %s %s %s %s' % (frame.f_code.co_filename, frame.f_lineno, event, frame.f_code.co_name))
1746
2007
  py_db, t, additional_info, cache_skips, frame_skips_cache = self._args
1747
2008
  if additional_info.is_tracing:
1748
- return None if event == 'call' else NO_FTRACE # we don't wan't to trace code invoked from pydevd_frame.trace_dispatch
2009
+ return None if event == "call" else NO_FTRACE # we don't wan't to trace code invoked from pydevd_frame.trace_dispatch
1749
2010
 
1750
2011
  additional_info.is_tracing += 1
1751
2012
  try:
1752
2013
  pydev_step_cmd = additional_info.pydev_step_cmd
1753
2014
  is_stepping = pydev_step_cmd != -1
1754
2015
  if py_db.pydb_disposed:
1755
- return None if event == 'call' else NO_FTRACE
2016
+ return None if event == "call" else NO_FTRACE
1756
2017
 
1757
2018
  # if thread is not alive, cancel trace_dispatch processing
1758
2019
  if not is_thread_alive(t):
1759
2020
  py_db.notify_thread_not_alive(get_current_thread_id(t))
1760
- return None if event == 'call' else NO_FTRACE
2021
+ return None if event == "call" else NO_FTRACE
1761
2022
 
1762
2023
  # Note: it's important that the context name is also given because we may hit something once
1763
2024
  # in the global context and another in the local context.
@@ -1765,23 +2026,30 @@ cdef class ThreadTracer:
1765
2026
  if frame_cache_key in cache_skips:
1766
2027
  if not is_stepping:
1767
2028
  # if DEBUG: print('skipped: trace_dispatch (cache hit)', frame_cache_key, frame.f_lineno, event, frame.f_code.co_name)
1768
- return None if event == 'call' else NO_FTRACE
2029
+ return None if event == "call" else NO_FTRACE
1769
2030
  else:
1770
2031
  # When stepping we can't take into account caching based on the breakpoints (only global filtering).
1771
2032
  if cache_skips.get(frame_cache_key) == 1:
1772
-
1773
- if additional_info.pydev_original_step_cmd in (107, 144) and not _global_notify_skipped_step_in:
2033
+ if (
2034
+ additional_info.pydev_original_step_cmd in (107, 144)
2035
+ and not _global_notify_skipped_step_in
2036
+ ):
1774
2037
  notify_skipped_step_in_because_of_filters(py_db, frame)
1775
2038
 
1776
2039
  back_frame = frame.f_back
1777
- if back_frame is not None and pydev_step_cmd in (107, 144, 109, 160):
2040
+ if back_frame is not None and pydev_step_cmd in (
2041
+ 107,
2042
+ 144,
2043
+ 109,
2044
+ 160,
2045
+ ):
1778
2046
  back_frame_cache_key = back_frame.f_code
1779
2047
  if cache_skips.get(back_frame_cache_key) == 1:
1780
2048
  # if DEBUG: print('skipped: trace_dispatch (cache hit: 1)', frame_cache_key, frame.f_lineno, event, frame.f_code.co_name)
1781
- return None if event == 'call' else NO_FTRACE
2049
+ return None if event == "call" else NO_FTRACE
1782
2050
  else:
1783
2051
  # if DEBUG: print('skipped: trace_dispatch (cache hit: 2)', frame_cache_key, frame.f_lineno, event, frame.f_code.co_name)
1784
- return None if event == 'call' else NO_FTRACE
2052
+ return None if event == "call" else NO_FTRACE
1785
2053
 
1786
2054
  try:
1787
2055
  # Make fast path faster!
@@ -1789,39 +2057,50 @@ cdef class ThreadTracer:
1789
2057
  except:
1790
2058
  abs_path_canonical_path_and_base = get_abs_path_real_path_and_base_from_frame(frame)
1791
2059
 
1792
- file_type = py_db.get_file_type(frame, abs_path_canonical_path_and_base) # we don't want to debug threading or anything related to pydevd
2060
+ file_type = py_db.get_file_type(
2061
+ frame, abs_path_canonical_path_and_base
2062
+ ) # we don't want to debug threading or anything related to pydevd
1793
2063
 
1794
2064
  if file_type is not None:
1795
2065
  if file_type == 1: # inlining LIB_FILE = 1
1796
2066
  if not py_db.in_project_scope(frame, abs_path_canonical_path_and_base[0]):
1797
2067
  # if DEBUG: print('skipped: trace_dispatch (not in scope)', abs_path_canonical_path_and_base[2], frame.f_lineno, event, frame.f_code.co_name, file_type)
1798
2068
  cache_skips[frame_cache_key] = 1
1799
- return None if event == 'call' else NO_FTRACE
2069
+ return None if event == "call" else NO_FTRACE
1800
2070
  else:
1801
2071
  # if DEBUG: print('skipped: trace_dispatch', abs_path_canonical_path_and_base[2], frame.f_lineno, event, frame.f_code.co_name, file_type)
1802
2072
  cache_skips[frame_cache_key] = 1
1803
- return None if event == 'call' else NO_FTRACE
2073
+ return None if event == "call" else NO_FTRACE
1804
2074
 
1805
2075
  if py_db.is_files_filter_enabled:
1806
2076
  if py_db.apply_files_filter(frame, abs_path_canonical_path_and_base[0], False):
1807
2077
  cache_skips[frame_cache_key] = 1
1808
2078
 
1809
- if is_stepping and additional_info.pydev_original_step_cmd in (107, 144) and not _global_notify_skipped_step_in:
2079
+ if (
2080
+ is_stepping
2081
+ and additional_info.pydev_original_step_cmd in (107, 144)
2082
+ and not _global_notify_skipped_step_in
2083
+ ):
1810
2084
  notify_skipped_step_in_because_of_filters(py_db, frame)
1811
2085
 
1812
2086
  # A little gotcha, sometimes when we're stepping in we have to stop in a
1813
2087
  # return event showing the back frame as the current frame, so, we need
1814
2088
  # to check not only the current frame but the back frame too.
1815
2089
  back_frame = frame.f_back
1816
- if back_frame is not None and pydev_step_cmd in (107, 144, 109, 160):
2090
+ if back_frame is not None and pydev_step_cmd in (
2091
+ 107,
2092
+ 144,
2093
+ 109,
2094
+ 160,
2095
+ ):
1817
2096
  if py_db.apply_files_filter(back_frame, back_frame.f_code.co_filename, False):
1818
2097
  back_frame_cache_key = back_frame.f_code
1819
2098
  cache_skips[back_frame_cache_key] = 1
1820
2099
  # if DEBUG: print('skipped: trace_dispatch (filtered out: 1)', frame_cache_key, frame.f_lineno, event, frame.f_code.co_name)
1821
- return None if event == 'call' else NO_FTRACE
2100
+ return None if event == "call" else NO_FTRACE
1822
2101
  else:
1823
2102
  # if DEBUG: print('skipped: trace_dispatch (filtered out: 2)', frame_cache_key, frame.f_lineno, event, frame.f_code.co_name)
1824
- return None if event == 'call' else NO_FTRACE
2103
+ return None if event == "call" else NO_FTRACE
1825
2104
 
1826
2105
  # if DEBUG: print('trace_dispatch', filename, frame.f_lineno, event, frame.f_code.co_name, file_type)
1827
2106
 
@@ -1829,28 +2108,35 @@ cdef class ThreadTracer:
1829
2108
  # reference to the frame).
1830
2109
  ret = PyDBFrame(
1831
2110
  (
1832
- py_db, abs_path_canonical_path_and_base, additional_info, t, frame_skips_cache, frame_cache_key,
2111
+ py_db,
2112
+ abs_path_canonical_path_and_base,
2113
+ additional_info,
2114
+ t,
2115
+ frame_skips_cache,
2116
+ frame_cache_key,
1833
2117
  )
1834
2118
  ).trace_dispatch(frame, event, arg)
1835
2119
  if ret is None:
1836
2120
  # 1 means skipped because of filters.
1837
2121
  # 2 means skipped because no breakpoints were hit.
1838
2122
  cache_skips[frame_cache_key] = 2
1839
- return None if event == 'call' else NO_FTRACE
2123
+ return None if event == "call" else NO_FTRACE
1840
2124
 
2125
+ # fmt: off
1841
2126
  # IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
1842
2127
  frame.f_trace = SafeCallWrapper(ret) # Make sure we keep the returned tracer.
1843
2128
  # ELSE
1844
2129
  # frame.f_trace = ret # Make sure we keep the returned tracer.
1845
2130
  # ENDIF
2131
+ # fmt: on
1846
2132
  return ret
1847
2133
 
1848
2134
  except SystemExit:
1849
- return None if event == 'call' else NO_FTRACE
2135
+ return None if event == "call" else NO_FTRACE
1850
2136
 
1851
2137
  except Exception:
1852
2138
  if py_db.pydb_disposed:
1853
- return None if event == 'call' else NO_FTRACE # Don't log errors when we're shutting down.
2139
+ return None if event == "call" else NO_FTRACE # Don't log errors when we're shutting down.
1854
2140
  # Log it
1855
2141
  try:
1856
2142
  if pydev_log_exception is not None:
@@ -1860,7 +2146,7 @@ cdef class ThreadTracer:
1860
2146
  # Error logging? We're really in the interpreter shutdown...
1861
2147
  # (https://github.com/fabioz/PyDev.Debugger/issues/8)
1862
2148
  pass
1863
- return None if event == 'call' else NO_FTRACE
2149
+ return None if event == "call" else NO_FTRACE
1864
2150
  finally:
1865
2151
  additional_info.is_tracing -= 1
1866
2152
 
@@ -1882,3 +2168,8 @@ if USE_CUSTOM_SYS_CURRENT_FRAMES_MAP:
1882
2168
  return _original_call(self, frame, event, arg)
1883
2169
 
1884
2170
  ThreadTracer.__call__ = __call__
2171
+
2172
+ if PYDEVD_USE_SYS_MONITORING:
2173
+
2174
+ def fix_top_level_trace_and_get_trace_func(*args, **kwargs):
2175
+ raise RuntimeError("Not used in sys.monitoring mode.")