debugpy 1.8.0__zip → 1.8.2__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {debugpy-1.8.0/src/debugpy.egg-info → debugpy-1.8.2}/PKG-INFO +2 -1
- debugpy-1.8.2/pyproject.toml +76 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/setup.py +9 -1
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_safe_repr.py +3 -3
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py +7 -1
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.dll +0 -0
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.pdb +0 -0
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.dll +0 -0
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.pdb +0 -0
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.exe +0 -0
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.pdb +0 -0
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.exe +0 -0
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.pdb +0 -0
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.dll +0 -0
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.pdb +0 -0
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.dll +0 -0
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.pdb +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/compile_windows.bat +10 -6
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_plugins/__init__.py +2 -0
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/__init__.py +2 -0
- debugpy-1.8.2/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/__init__.py +2 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_version.py +3 -3
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/adapter/clients.py +29 -5
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/adapter/launchers.py +8 -1
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/adapter/servers.py +3 -1
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/adapter/sessions.py +9 -0
- {debugpy-1.8.0 → debugpy-1.8.2/src/debugpy.egg-info}/PKG-INFO +2 -1
- debugpy-1.8.2/src/debugpy.egg-info/SOURCES.txt +307 -0
- debugpy-1.8.0/pyproject.toml +0 -24
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/build_tools/build.py +0 -177
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/build_tools/build_binaries_osx.py +0 -60
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/build_tools/build_binaries_windows.py +0 -85
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/build_tools/check_no_git_modifications.py +0 -32
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/build_tools/generate_code.py +0 -233
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/build_tools/names_to_rename.py +0 -318
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/build_tools/rename_pep8.py +0 -131
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/conftest.py +0 -369
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/interpreterInfo.py +0 -255
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/pycompletionserver.py +0 -372
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.dll +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.pdb +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.dll +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.pdb +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.exe +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.pdb +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.exe +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.pdb +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.dll +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.pdb +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.dll +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.pdb +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/runfiles.py +0 -317
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/setup.py +0 -186
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/stubs/_django_manager_body.py +0 -414
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/test_pydevd_reload/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/test_pydevd_reload/test_pydevd_reload.py +0 -573
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests/test_check_pydevconsole.py +0 -113
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests/test_get_referrers.py +0 -125
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests/test_jyserver.py +0 -140
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests/test_jysimpleTipper.py +0 -242
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests/test_pydev_ipython_011.py +0 -308
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests/test_pydevconsole.py +0 -277
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests/test_pyserver.py +0 -155
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests/test_simpleTipper.py +0 -243
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_mainloop/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_mainloop/gui-glut.py +0 -52
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_mainloop/gui-gtk.py +0 -35
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_mainloop/gui-gtk3.py +0 -33
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_mainloop/gui-pyglet.py +0 -28
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_mainloop/gui-qt.py +0 -36
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_mainloop/gui-tk.py +0 -33
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_mainloop/gui-wx.py +0 -103
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/check_debug_python.py +0 -38
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/debug_constants.py +0 -45
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/debugger_fixtures.py +0 -575
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/debugger_unittest.py +0 -1491
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/flask1/app.py +0 -60
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_17/manage.py +0 -10
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_17/my_app/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_17/my_app/admin.py +0 -3
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_17/my_app/forms.py +0 -4
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_17/my_app/models.py +0 -3
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_17/my_app/tests.py +0 -3
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_17/my_app/urls.py +0 -12
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_17/my_app/views.py +0 -73
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_17/my_django_proj_17/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_17/my_django_proj_17/settings.py +0 -86
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_17/my_django_proj_17/urls.py +0 -11
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_17/my_django_proj_17/wsgi.py +0 -14
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_21/manage.py +0 -15
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_21/my_app/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_21/my_app/admin.py +0 -3
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_21/my_app/apps.py +0 -5
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_21/my_app/forms.py +0 -4
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_21/my_app/migrations/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_21/my_app/models.py +0 -3
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_21/my_app/tests.py +0 -72
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_21/my_app/urls.py +0 -15
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_21/my_app/views.py +0 -80
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_21/my_django_proj_21/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_21/my_django_proj_21/settings.py +0 -120
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_21/my_django_proj_21/urls.py +0 -23
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_django_proj_21/my_django_proj_21/wsgi.py +0 -16
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_extensions/pydevd_plugins/extensions/pydevd_plugin_test_events.py +0 -18
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/my_extensions/pydevd_plugins/extensions/pydevd_plugin_test_exttype.py +0 -20
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/performance_check.py +0 -245
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/regression_check.py +0 -240
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resource_path_translation/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resource_path_translation/other.py +0 -6
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_bytecode_big_method.py +0 -331
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_bytecode_constructs.py +0 -126
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_bytecode_many_names_example.py +0 -268
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_bytecode_overflow_example.py +0 -89
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_bytecode_super.py +0 -22
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case1.py +0 -61
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case13.py +0 -43
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case14.py +0 -29
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case15.py +0 -29
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case15_execfile.py +0 -1
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case16.py +0 -12
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case17.py +0 -44
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case17a.py +0 -18
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case18.py +0 -23
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case19.py +0 -10
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case2.py +0 -24
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case20.py +0 -38
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case3.py +0 -8
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case4.py +0 -22
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case56.py +0 -9
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case89.py +0 -16
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_adjust_breakpoint.py +0 -11
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_async.py +0 -21
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_asyncio.py +0 -37
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_attach_to_pid_multiple_threads.py +0 -47
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_attach_to_pid_simple.py +0 -17
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_breakpoint.py +0 -7
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_breakpoint2.py +0 -7
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_breakpoint_condition_exc.py +0 -8
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_breakpoint_remote.py +0 -15
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_breakpoint_remote_no_import.py +0 -14
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_change_breaks.py +0 -12
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_check_tracer.py +0 -100
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_completions.py +0 -23
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_custom_frames.py +0 -23
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_custom_message.py +0 -14
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_deadlock_thread_eval.py +0 -72
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_debug_options.py +0 -11
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_deep_stacks.py +0 -16
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_dir_exception.py +0 -13
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_dont_trace.py +0 -3
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_dont_trace_test.py +0 -18
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_evaluate.py +0 -8
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_event_ext.py +0 -1
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_exceptions.py +0 -22
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_frame_eval.py +0 -70
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_generator.py +0 -18
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_generator2.py +0 -17
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_generator3.py +0 -13
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_generator_py2.py +0 -16
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_generator_py3.py +0 -14
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_generator_step_in.py +0 -13
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_get_next_statement_targets.py +0 -26
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_get_thread_stack.py +0 -21
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_gevent.py +0 -60
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_gevent_simple.py +0 -21
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_gevent_subprocess.py +0 -16
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_globals.py +0 -12
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_gui_event_loop.py +0 -26
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_gui_event_loop_qt5.py +0 -51
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_hasattr_crash.py +0 -10
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_hit_count.py +0 -6
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_ignore_exceptions.py +0 -25
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_import_imported.py +0 -2
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_import_main.py +0 -3
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_lambda_multiline.py +0 -8
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_lamda.py +0 -5
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_large_exception_stack.py +0 -16
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_linecache.py +0 -26
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_linecache_existing_file.py +0 -12
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_listen_dap_messages.py +0 -59
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_local_variables.py +0 -14
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_local_variables2.py +0 -12
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_local_variables3.py +0 -82
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_local_variables_hex.py +0 -12
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_logging.py +0 -63
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_m_switch.py +0 -3
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_m_switch_2.py +0 -2
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_matplotlib.py +0 -23
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_method_single_line.py +0 -5
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_module.py +0 -17
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_module_entry_point.py +0 -2
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_multi_threads_stepping.py +0 -55
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_multiple_threads.py +0 -32
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_multiprocessing.py +0 -15
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_multiprocessing_2.py +0 -20
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_multiprocessing_pool.py +0 -17
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_multiprocessing_stopped_threads.py +0 -32
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_namedtuple.py +0 -6
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_no_subprocess_patching.py +0 -35
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_odict.py +0 -14
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_path_translation.py +0 -14
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_pause_continue.py +0 -13
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_print.py +0 -1
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_pydevd_customization.py +0 -62
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_python_c.py +0 -21
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_qthread1.py +0 -31
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_qthread2.py +0 -40
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_qthread3.py +0 -35
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_qthread4.py +0 -47
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_quoting.py +0 -26
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_raise_with_cause.py +0 -23
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_raise_with_cause_msg.py +0 -12
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_redirect.py +0 -26
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_remote.py +0 -17
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_remote_1.py +0 -47
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_remote_2.py +0 -11
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_remote_threads.py +0 -31
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_remote_unhandled_exceptions.py +0 -15
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_remote_unhandled_exceptions2.py +0 -21
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_remove_breakpoint.py +0 -14
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_replace_process.py +0 -18
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_return_value.py +0 -16
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_return_value_asyncio.py +0 -26
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_scapy.py +0 -2
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_scoped_stepping.py +0 -145
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_scoped_stepping_print.py +0 -7
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_scoped_stepping_target.py +0 -3
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_scoped_stepping_target2.py +0 -9
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_scoped_stepping_target_async.py +0 -9
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_set_next_statement.py +0 -10
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_settrace.py +0 -26
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_show_bytecode.py +0 -25
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_simple_calls.py +0 -18
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_skip_breakpoint_in_exceptions.py +0 -8
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_smart_step_into.py +0 -20
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_smart_step_into2.py +0 -17
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_smart_step_into3.py +0 -21
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_source_map_goto_target.py +0 -24
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_source_mapping.py +0 -31
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_source_mapping_and_reference.py +0 -57
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_source_mapping_jmc.py +0 -35
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_source_reference.py +0 -32
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_stepping.py +0 -19
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_stop_async_iteration.py +0 -14
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_subprocess_and_fork.py +0 -47
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_subprocess_zip.py +0 -34
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_suspend_all.py +0 -33
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_suspend_policy.py +0 -29
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_sysexit.py +0 -9
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_sysexit_0.py +0 -9
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_sysexit_none.py +0 -9
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_terminate.py +0 -37
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_thread_creation_deadlock.py +0 -26
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_thread_started_exited.py +0 -18
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_trace_dispatch.py +0 -18
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_tracing.py +0 -14
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_trio.py +0 -30
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_type_ext.py +0 -8
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_unhandled_exception_get_stack.py +0 -12
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_unhandled_exceptions.py +0 -47
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_unhandled_exceptions_custom.py +0 -53
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_unhandled_exceptions_generator.py +0 -19
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_unhandled_exceptions_listcomp.py +0 -19
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_unhandled_exceptions_on_top_level.py +0 -1
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_unhandled_exceptions_on_top_level2.py +0 -6
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_unhandled_just_my_code.py +0 -13
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_user_unhandled.py +0 -14
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_user_unhandled2.py +0 -5
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_variables_with_same_name.py +0 -15
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_wait_for_attach.py +0 -3
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_wait_for_attach_debugpy_mode.py +0 -45
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_wait_for_attach_impl.py +0 -52
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_warnings.py +0 -22
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_yield_from.py +0 -12
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_zip_files.py +0 -17
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_performance_1.py +0 -34
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_performance_2.py +0 -25
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_performance_3.py +0 -15
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_pydev_coverage_cyrillic_encoding_py2.py +0 -8
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_pydev_coverage_cyrillic_encoding_py3.py +0 -8
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_pydev_coverage_syntax_error.py +0 -8
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/_pydevd_test_find_main_thread_id.py +0 -159
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/launch/foo/__main__.py +0 -6
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/launch/foo/bar.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/launch_py2/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/launch_py2/foo/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/launch_py2/foo/__main__.py +0 -6
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/launch_py2/foo/bar.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/my_code/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/my_code/my_code.py +0 -15
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/my_code/my_code_coroutine.py +0 -27
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/my_code/my_code_coroutine_user_unhandled.py +0 -34
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/my_code/my_code_coroutine_user_unhandled_no_stop.py +0 -34
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/my_code/my_code_double_step.py +0 -8
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/my_code/my_code_exception.py +0 -14
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/my_code/my_code_exception_on_other.py +0 -14
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/my_code/my_code_exception_user_unhandled.py +0 -22
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/my_code/my_code_on_entry.py +0 -1
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/not_my_code/__init__.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/not_my_code/empty_file.py +0 -0
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/not_my_code/main_on_entry.py +0 -7
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/not_my_code/main_on_entry2.py +0 -24
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/not_my_code/not_my_coroutine.py +0 -5
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/not_my_code/other.py +0 -15
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/not_my_code/other_noop.py +0 -2
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/wrong_bytecode/_debugger_case_wrong_bytecode.py +0 -47
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/wrong_bytecode/helper/__init__.py +0 -58
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/wrong_bytecode/helper/helper/__init__.py +0 -56
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/resources/wrong_bytecode/helper/helper/helper/__init__.py +0 -56
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_additional_thread_info.py +0 -82
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_bytecode_manipulation.py +0 -279
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_code_obj_to_source_code.py +0 -95
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_collect_bytecode_info.py +0 -698
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_console.py +0 -201
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_convert_utilities.py +0 -588
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_debugger.py +0 -4511
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_debugger_json.py +0 -6653
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_dump_threads.py +0 -8
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_evaluate_expression.py +0 -321
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_extract_token.py +0 -49
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_fixtures.py +0 -113
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_frame_eval_and_tracing.py +0 -278
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_frame_evaluator.py +0 -131
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_frame_utils.py +0 -251
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_null.py +0 -8
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_process_command_line.py +0 -28
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_pydev_monkey.py +0 -526
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_pydevcoverage.py +0 -68
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_pydevd_api.py +0 -43
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_pydevd_filtering.py +0 -266
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_pydevd_io.py +0 -225
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_resolvers.py +0 -499
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_run.py +0 -115
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_safe_repr.py +0 -690
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_save_locals.py +0 -101
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_schema.py +0 -142
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_single_notification.py +0 -297
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_smart_step_into_bytecode.py +0 -1132
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_suspended_frames_manager.py +0 -134
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_timeout_tracker.py +0 -128
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_tracing_gotchas.py +0 -101
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_tracing_on_top_level.py +0 -485
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_python/test_utilities.py +0 -550
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/samples/nested_dir/__init__.py +0 -1
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/samples/nested_dir/nested2/__init__.py +0 -1
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/samples/nested_dir/nested2/deep_nest_test.py +0 -22
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/samples/nested_dir/nested2/non_test_file.py +0 -3
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/samples/nested_dir/nested3/__init__.py +0 -1
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/samples/nested_dir/nested3/non_test_file.py +0 -3
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/samples/nested_dir/non_test_file.py +0 -3
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/samples/nested_dir/simple4_test.py +0 -16
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/samples/non_test_file.py +0 -3
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/samples/simple2_test.py +0 -16
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/samples/simple3_test.py +0 -16
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/samples/simpleClass_test.py +0 -14
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/samples/simpleModule_test.py +0 -16
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/samples/simple_test.py +0 -45
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/test_pydevd_property.py +0 -124
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/test_pydevdio.py +0 -36
- debugpy-1.8.0/src/debugpy/_vendored/pydevd/tests_runfiles/test_runfiles.py +0 -437
- debugpy-1.8.0/src/debugpy.egg-info/SOURCES.txt +0 -626
- {debugpy-1.8.0 → debugpy-1.8.2}/DESCRIPTION.md +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/LICENSE +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/MANIFEST.in +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/README.md +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/setup.cfg +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/ThirdPartyNotices.txt +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/__main__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/_pydevd_packaging.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/_util.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/force_pydevd.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_calltip_util.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_completer.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_execfile.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_filesystem_encoding.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_getopt.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_imports_tipper.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_jy_imports_tipper.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_log.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_saved_modules.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_sys_patch.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_tipper_common.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/fsnotify/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_console_utils.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_import_hook.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_imports.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_ipython_console.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_ipython_console_011.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_is_thread_alive.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_localhost.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_log.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey_qt.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_override.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_umd.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_versioncheck.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_runfiles/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_coverage.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_nose.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_parallel.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_parallel_client.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_pytest2.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_unittest.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_xml_rpc.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/__main__pydevd_gen_debug_adapter_protocol.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/debugProtocol.json +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/debugProtocolCustom.json +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_base_schema.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_schema.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_schema_log.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevconsole_code.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_additional_thread_info.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_additional_thread_info_regular.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_api.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_breakpoints.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_bytecode_utils.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_code_to_source.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_collect_bytecode_info.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm_constants.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_command_line_handling.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_concurrency_analyser/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_concurrency_analyser/pydevd_concurrency_logger.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_concurrency_analyser/pydevd_thread_wrappers.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_console.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_constants.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_custom_frames.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.c +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.pxd +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.pyx +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython_wrapper.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_daemon_thread.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_defaults.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_dont_trace.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_dont_trace_files.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_exec2.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_extension_api.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_extension_utils.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_filtering.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_frame.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_frame_utils.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_gevent_integration.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_import_class.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_io.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_json_debug_options.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_json.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_xml.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_plugin_utils.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command_json.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_referrers.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_reload.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_resolver.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_save_locals.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_signature.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_source_mapping.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_stackless.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_suspended_frames.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_thread_lifecycle.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_timeout.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_trace_api.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_trace_dispatch.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_trace_dispatch_regular.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_traceproperty.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_utils.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vars.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vm_type.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_xml.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/.gitignore +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_cython_wrapper.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_main.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.c +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pxd +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pyx +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.template.pyx +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_tracing.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_modify_bytecode.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/release_mem.h +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/README.txt +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/bytecode.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/cfg.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/concrete.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/flags.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/instr.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/peephole_opt.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_bytecode.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_cfg.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_code.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_concrete.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_flags.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_instr.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_misc.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_peephole_opt.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/util_annotation.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode-0.13.0.dev0.dist-info/COPYING +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode-0.13.0.dev0.dist-info/INSTALLER +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode-0.13.0.dev0.dist-info/METADATA +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode-0.13.0.dev0.dist-info/RECORD +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode-0.13.0.dev0.dist-info/REQUESTED +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode-0.13.0.dev0.dist-info/WHEEL +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode-0.13.0.dev0.dist-info/direct_url.json +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode-0.13.0.dev0.dist-info/top_level.txt +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/pydevd_fix_code.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_app_engine_debug_startup.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_coverage.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/README +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhook.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookglut.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookgtk.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookgtk3.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookpyglet.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookqt4.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookqt5.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhooktk.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookwx.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/matplotlibtools.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/qt.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/qt_for_kernel.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/qt_loaders.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_ipython/version.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_pysrc.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_run_in_console.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_sitecustomize/__not_in_default_pythonpath.txt +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydev_sitecustomize/sitecustomize.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevconsole.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/README.txt +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_always_live_program.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_check.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_test_attach_to_process.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_test_attach_to_process_linux.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_pydevd.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_script.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace.hpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace_310.hpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace_311.hpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace_common.hpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_settrace.hpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_utils.hpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_version.hpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/python.h +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/ref_utils.hpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/.gitignore +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/attach.cpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_linux.sh +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_mac.sh +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_manylinux.cmd +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/lldb_prepare.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/breakpoint.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/compat.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/crash.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/debug.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/disasm.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/event.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/interactive.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/module.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/process.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/registry.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/search.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/sql.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/system.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/textio.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/thread.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/util.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/advapi32.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/context_amd64.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/context_i386.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/dbghelp.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/defines.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/gdi32.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/kernel32.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/ntdll.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/peb_teb.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/psapi.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/shell32.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/shlwapi.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/user32.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/version.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/wtsapi32.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/window.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/attach.cpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/attach.h +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/inject_dll.cpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/py_win_helpers.hpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/run_code_in_memory.hpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/run_code_on_dllmain.cpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/stdafx.cpp +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/stdafx.h +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/targetver.h +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_file_utils.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_plugins/django_debug.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/README.md +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_helpers.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_plugin_numpy_types.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_plugin_pandas_types.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_plugins_django_form_str.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_plugins/jinja2_debug.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_plugins/pydevd_line_validation.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/pydevd_tracing.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/_vendored/pydevd/setup_pydevd_cython.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/adapter/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/adapter/__main__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/adapter/components.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/common/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/common/json.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/common/log.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/common/messaging.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/common/singleton.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/common/sockets.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/common/stacks.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/common/timestamp.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/common/util.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/launcher/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/launcher/__main__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/launcher/debuggee.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/launcher/handlers.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/launcher/output.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/launcher/winapi.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/public_api.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/server/__init__.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/server/api.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/server/attach_pid_injected.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy/server/cli.py +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy.egg-info/dependency_links.txt +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/src/debugpy.egg-info/top_level.txt +0 -0
- {debugpy-1.8.0 → debugpy-1.8.2}/versioneer.py +0 -0
|
@@ -1,4511 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
'''
|
|
3
|
-
The idea is that we record the commands sent to the debugger and reproduce them from this script
|
|
4
|
-
(so, this works as the client, which spawns the debugger as a separate process and communicates
|
|
5
|
-
to it as if it was run from the outside)
|
|
6
|
-
|
|
7
|
-
Note that it's a python script but it'll spawn a process to run as jython, ironpython and as python.
|
|
8
|
-
'''
|
|
9
|
-
import time
|
|
10
|
-
|
|
11
|
-
import pytest
|
|
12
|
-
|
|
13
|
-
from tests_python import debugger_unittest
|
|
14
|
-
from tests_python.debugger_unittest import (CMD_SET_PROPERTY_TRACE, REASON_CAUGHT_EXCEPTION,
|
|
15
|
-
REASON_UNCAUGHT_EXCEPTION, REASON_STOP_ON_BREAKPOINT, REASON_THREAD_SUSPEND, overrides, CMD_THREAD_CREATE,
|
|
16
|
-
CMD_GET_THREAD_STACK, REASON_STEP_INTO_MY_CODE, CMD_GET_EXCEPTION_DETAILS, IS_IRONPYTHON, IS_JYTHON, IS_CPYTHON,
|
|
17
|
-
IS_APPVEYOR, wait_for_condition, CMD_GET_FRAME, CMD_GET_BREAKPOINT_EXCEPTION,
|
|
18
|
-
CMD_THREAD_SUSPEND, CMD_STEP_OVER, REASON_STEP_OVER, CMD_THREAD_SUSPEND_SINGLE_NOTIFICATION,
|
|
19
|
-
CMD_THREAD_RESUME_SINGLE_NOTIFICATION, REASON_STEP_RETURN, REASON_STEP_RETURN_MY_CODE,
|
|
20
|
-
REASON_STEP_OVER_MY_CODE, REASON_STEP_INTO, CMD_THREAD_KILL, IS_PYPY, REASON_STOP_ON_START,
|
|
21
|
-
CMD_SMART_STEP_INTO, CMD_GET_VARIABLE)
|
|
22
|
-
from _pydevd_bundle.pydevd_constants import IS_WINDOWS, IS_PY38_OR_GREATER, \
|
|
23
|
-
IS_MAC
|
|
24
|
-
from _pydevd_bundle.pydevd_comm_constants import CMD_RELOAD_CODE, CMD_INPUT_REQUESTED, \
|
|
25
|
-
CMD_RUN_CUSTOM_OPERATION
|
|
26
|
-
import json
|
|
27
|
-
import pydevd_file_utils
|
|
28
|
-
import subprocess
|
|
29
|
-
import threading
|
|
30
|
-
from _pydev_bundle import pydev_log
|
|
31
|
-
from urllib.parse import unquote, unquote_plus
|
|
32
|
-
|
|
33
|
-
from tests_python.debug_constants import * # noqa
|
|
34
|
-
|
|
35
|
-
pytest_plugins = [
|
|
36
|
-
str('tests_python.debugger_fixtures'),
|
|
37
|
-
]
|
|
38
|
-
|
|
39
|
-
builtin_qualifier = "builtins"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='Test needs gc.get_referrers/reference counting to really check anything.')
|
|
43
|
-
def test_case_referrers(case_setup):
|
|
44
|
-
with case_setup.test_file('_debugger_case1.py') as writer:
|
|
45
|
-
writer.log.append('writing add breakpoint')
|
|
46
|
-
writer.write_add_breakpoint(6, 'set_up')
|
|
47
|
-
|
|
48
|
-
writer.log.append('making initial run')
|
|
49
|
-
writer.write_make_initial_run()
|
|
50
|
-
|
|
51
|
-
writer.log.append('waiting for breakpoint hit')
|
|
52
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
53
|
-
thread_id = hit.thread_id
|
|
54
|
-
frame_id = hit.frame_id
|
|
55
|
-
|
|
56
|
-
writer.log.append('get frame')
|
|
57
|
-
writer.write_get_frame(thread_id, frame_id)
|
|
58
|
-
|
|
59
|
-
writer.log.append('step over')
|
|
60
|
-
writer.write_step_over(thread_id)
|
|
61
|
-
|
|
62
|
-
writer.log.append('get frame')
|
|
63
|
-
writer.write_get_frame(thread_id, frame_id)
|
|
64
|
-
|
|
65
|
-
writer.log.append('run thread')
|
|
66
|
-
writer.write_run_thread(thread_id)
|
|
67
|
-
|
|
68
|
-
writer.log.append('asserting')
|
|
69
|
-
try:
|
|
70
|
-
assert 13 == writer._sequence, 'Expected 13. Had: %s' % writer._sequence
|
|
71
|
-
except:
|
|
72
|
-
writer.log.append('assert failed!')
|
|
73
|
-
raise
|
|
74
|
-
writer.log.append('asserted')
|
|
75
|
-
|
|
76
|
-
writer.finished_ok = True
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
def test_case_2(case_setup):
|
|
80
|
-
with case_setup.test_file('_debugger_case2.py') as writer:
|
|
81
|
-
writer.write_add_breakpoint(3, 'Call4') # seq = 3
|
|
82
|
-
writer.write_make_initial_run()
|
|
83
|
-
|
|
84
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
85
|
-
thread_id = hit.thread_id
|
|
86
|
-
frame_id = hit.frame_id
|
|
87
|
-
|
|
88
|
-
writer.write_get_frame(thread_id, frame_id) # Note: write get frame but not waiting for it to be gotten.
|
|
89
|
-
|
|
90
|
-
writer.write_add_breakpoint(14, 'Call2')
|
|
91
|
-
|
|
92
|
-
writer.write_run_thread(thread_id)
|
|
93
|
-
|
|
94
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
95
|
-
thread_id = hit.thread_id
|
|
96
|
-
frame_id = hit.frame_id
|
|
97
|
-
|
|
98
|
-
writer.write_get_frame(thread_id, frame_id) # Note: write get frame but not waiting for it to be gotten.
|
|
99
|
-
|
|
100
|
-
writer.write_run_thread(thread_id)
|
|
101
|
-
|
|
102
|
-
writer.log.append('Checking sequence. Found: %s' % (writer._sequence))
|
|
103
|
-
assert 15 == writer._sequence, 'Expected 15. Had: %s' % writer._sequence
|
|
104
|
-
|
|
105
|
-
writer.log.append('Marking finished ok.')
|
|
106
|
-
writer.finished_ok = True
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
@pytest.mark.parametrize(
|
|
110
|
-
'skip_suspend_on_breakpoint_exception, skip_print_breakpoint_exception',
|
|
111
|
-
(
|
|
112
|
-
[['NameError'], []],
|
|
113
|
-
[['NameError'], ['NameError']],
|
|
114
|
-
[[], []], # Empty means it'll suspend/print in any exception
|
|
115
|
-
[[], ['NameError']],
|
|
116
|
-
[['ValueError'], ['Exception']],
|
|
117
|
-
[['Exception'], ['ValueError']], # ValueError will also suspend/print since we're dealing with a NameError
|
|
118
|
-
)
|
|
119
|
-
)
|
|
120
|
-
def test_case_breakpoint_condition_exc(case_setup, skip_suspend_on_breakpoint_exception, skip_print_breakpoint_exception):
|
|
121
|
-
|
|
122
|
-
msgs_in_stderr = (
|
|
123
|
-
'Error while evaluating expression in conditional breakpoint: i > 5',
|
|
124
|
-
'Traceback (most recent call last):',
|
|
125
|
-
'File "<string>", line 1, in <module>',
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
# It could be one or the other in PyPy depending on the version.
|
|
129
|
-
msgs_one_in_stderr = (
|
|
130
|
-
"NameError: name 'i' is not defined",
|
|
131
|
-
"global name 'i' is not defined",
|
|
132
|
-
)
|
|
133
|
-
|
|
134
|
-
def _ignore_stderr_line(line):
|
|
135
|
-
if original_ignore_stderr_line(line):
|
|
136
|
-
return True
|
|
137
|
-
|
|
138
|
-
for msg in msgs_in_stderr + msgs_one_in_stderr:
|
|
139
|
-
if msg in line:
|
|
140
|
-
return True
|
|
141
|
-
|
|
142
|
-
return False
|
|
143
|
-
|
|
144
|
-
with case_setup.test_file('_debugger_case_breakpoint_condition_exc.py') as writer:
|
|
145
|
-
|
|
146
|
-
original_ignore_stderr_line = writer._ignore_stderr_line
|
|
147
|
-
writer._ignore_stderr_line = _ignore_stderr_line
|
|
148
|
-
|
|
149
|
-
writer.write_suspend_on_breakpoint_exception(skip_suspend_on_breakpoint_exception, skip_print_breakpoint_exception)
|
|
150
|
-
|
|
151
|
-
expect_print = skip_print_breakpoint_exception in ([], ['ValueError'])
|
|
152
|
-
expect_suspend = skip_suspend_on_breakpoint_exception in ([], ['ValueError'])
|
|
153
|
-
|
|
154
|
-
breakpoint_id = writer.write_add_breakpoint(
|
|
155
|
-
writer.get_line_index_with_content('break here'), 'Call', condition='i > 5')
|
|
156
|
-
|
|
157
|
-
if not expect_print:
|
|
158
|
-
_original = writer.reader_thread.on_message_found
|
|
159
|
-
|
|
160
|
-
def on_message_found(found_msg):
|
|
161
|
-
for msg in msgs_in_stderr + msgs_one_in_stderr:
|
|
162
|
-
assert msg not in found_msg
|
|
163
|
-
|
|
164
|
-
writer.reader_thread.on_message_found = on_message_found
|
|
165
|
-
|
|
166
|
-
writer.write_make_initial_run()
|
|
167
|
-
|
|
168
|
-
def check_error_msg(stderr):
|
|
169
|
-
for msg in msgs_in_stderr:
|
|
170
|
-
assert msg in stderr
|
|
171
|
-
|
|
172
|
-
for msg in msgs_one_in_stderr:
|
|
173
|
-
if msg in stderr:
|
|
174
|
-
break
|
|
175
|
-
else:
|
|
176
|
-
raise AssertionError('Did not find any of: %s in stderr: %s' % (
|
|
177
|
-
msgs_one_in_stderr, stderr))
|
|
178
|
-
|
|
179
|
-
if expect_print:
|
|
180
|
-
msg, ctx = writer.wait_for_output()
|
|
181
|
-
check_error_msg(msg.replace('>', '>'))
|
|
182
|
-
|
|
183
|
-
if expect_suspend:
|
|
184
|
-
writer.wait_for_message(CMD_GET_BREAKPOINT_EXCEPTION)
|
|
185
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
186
|
-
writer.write_run_thread(hit.thread_id)
|
|
187
|
-
|
|
188
|
-
if IS_JYTHON:
|
|
189
|
-
# Jython will break twice.
|
|
190
|
-
if expect_suspend:
|
|
191
|
-
writer.wait_for_message(CMD_GET_BREAKPOINT_EXCEPTION)
|
|
192
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
193
|
-
writer.write_run_thread(hit.thread_id)
|
|
194
|
-
|
|
195
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
196
|
-
thread_id = hit.thread_id
|
|
197
|
-
frame_id = hit.frame_id
|
|
198
|
-
|
|
199
|
-
writer.write_get_frame(thread_id, frame_id)
|
|
200
|
-
msg = writer.wait_for_message(CMD_GET_FRAME)
|
|
201
|
-
name_to_value = {}
|
|
202
|
-
for var in msg.var:
|
|
203
|
-
name_to_value[var['name']] = var['value']
|
|
204
|
-
assert name_to_value == {'i': 'int: 6', 'last_i': 'int: 6'}
|
|
205
|
-
|
|
206
|
-
writer.write_remove_breakpoint(breakpoint_id)
|
|
207
|
-
|
|
208
|
-
writer.write_run_thread(thread_id)
|
|
209
|
-
|
|
210
|
-
writer.finished_ok = True
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
def test_case_remove_breakpoint(case_setup):
|
|
214
|
-
with case_setup.test_file('_debugger_case_remove_breakpoint.py') as writer:
|
|
215
|
-
breakpoint_id = writer.write_add_breakpoint(writer.get_line_index_with_content('break here'))
|
|
216
|
-
writer.write_make_initial_run()
|
|
217
|
-
|
|
218
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
219
|
-
writer.write_remove_breakpoint(breakpoint_id)
|
|
220
|
-
writer.write_run_thread(hit.thread_id)
|
|
221
|
-
|
|
222
|
-
writer.finished_ok = True
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
def test_case_double_remove_breakpoint(case_setup):
|
|
226
|
-
|
|
227
|
-
with case_setup.test_file('_debugger_case_remove_breakpoint.py') as writer:
|
|
228
|
-
breakpoint_id = writer.write_add_breakpoint(writer.get_line_index_with_content('break here'))
|
|
229
|
-
writer.write_make_initial_run()
|
|
230
|
-
|
|
231
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
232
|
-
writer.write_remove_breakpoint(breakpoint_id)
|
|
233
|
-
writer.write_remove_breakpoint(breakpoint_id) # Double-remove (just check that we don't have an error).
|
|
234
|
-
writer.write_run_thread(hit.thread_id)
|
|
235
|
-
|
|
236
|
-
writer.finished_ok = True
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
@pytest.mark.skipif(IS_IRONPYTHON, reason='This test fails once in a while due to timing issues on IronPython, so, skipping it.')
|
|
240
|
-
def test_case_3(case_setup):
|
|
241
|
-
with case_setup.test_file('_debugger_case3.py') as writer:
|
|
242
|
-
writer.write_make_initial_run()
|
|
243
|
-
time.sleep(.5)
|
|
244
|
-
breakpoint_id = writer.write_add_breakpoint(4, '')
|
|
245
|
-
|
|
246
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
247
|
-
thread_id = hit.thread_id
|
|
248
|
-
frame_id = hit.frame_id
|
|
249
|
-
|
|
250
|
-
writer.write_get_frame(thread_id, frame_id)
|
|
251
|
-
|
|
252
|
-
writer.write_run_thread(thread_id)
|
|
253
|
-
|
|
254
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
255
|
-
thread_id = hit.thread_id
|
|
256
|
-
frame_id = hit.frame_id
|
|
257
|
-
|
|
258
|
-
writer.write_get_frame(thread_id, frame_id)
|
|
259
|
-
|
|
260
|
-
writer.write_remove_breakpoint(breakpoint_id)
|
|
261
|
-
|
|
262
|
-
writer.write_run_thread(thread_id)
|
|
263
|
-
|
|
264
|
-
writer.finished_ok = True
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
def test_case_suspend_thread(case_setup):
|
|
268
|
-
with case_setup.test_file('_debugger_case4.py') as writer:
|
|
269
|
-
writer.write_make_initial_run()
|
|
270
|
-
|
|
271
|
-
thread_id = writer.wait_for_new_thread()
|
|
272
|
-
|
|
273
|
-
writer.write_suspend_thread(thread_id)
|
|
274
|
-
|
|
275
|
-
while True:
|
|
276
|
-
hit = writer.wait_for_breakpoint_hit((REASON_THREAD_SUSPEND, REASON_STOP_ON_BREAKPOINT))
|
|
277
|
-
if hit.name == 'sleep':
|
|
278
|
-
break # Ok, broke on 'sleep'.
|
|
279
|
-
else:
|
|
280
|
-
# i.e.: if it doesn't hit on 'sleep', release and pause again.
|
|
281
|
-
writer.write_run_thread(thread_id)
|
|
282
|
-
time.sleep(.1)
|
|
283
|
-
writer.write_suspend_thread(thread_id)
|
|
284
|
-
|
|
285
|
-
assert hit.thread_id == thread_id
|
|
286
|
-
|
|
287
|
-
writer.write_evaluate_expression('%s\t%s\t%s' % (hit.thread_id, hit.frame_id, 'LOCAL'), 'exit_while_loop()')
|
|
288
|
-
writer.wait_for_evaluation([
|
|
289
|
-
[
|
|
290
|
-
'<var name="exit_while_loop()" type="str" qualifier="{0}" value="str: ok'.format(builtin_qualifier),
|
|
291
|
-
'<var name="exit_while_loop()" type="str" value="str: ok"', # jython
|
|
292
|
-
]
|
|
293
|
-
])
|
|
294
|
-
|
|
295
|
-
writer.write_run_thread(thread_id)
|
|
296
|
-
|
|
297
|
-
writer.finished_ok = True
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
# Jython has a weird behavior: it seems it has fine-grained locking so that when
|
|
301
|
-
# we're inside the tracing other threads don't run (so, we can have only one
|
|
302
|
-
# thread paused in the debugger).
|
|
303
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Jython can only have one thread stopped at each time.')
|
|
304
|
-
def test_case_suspend_all_thread(case_setup):
|
|
305
|
-
with case_setup.test_file('_debugger_case_suspend_all.py') as writer:
|
|
306
|
-
writer.write_make_initial_run()
|
|
307
|
-
|
|
308
|
-
main_thread_id = writer.wait_for_new_thread() # Main thread
|
|
309
|
-
thread_id1 = writer.wait_for_new_thread() # Thread 1
|
|
310
|
-
thread_id2 = writer.wait_for_new_thread() # Thread 2
|
|
311
|
-
|
|
312
|
-
# Ok, all threads created, let's wait for the main thread to get to the join.
|
|
313
|
-
writer.wait_for_thread_join(main_thread_id)
|
|
314
|
-
|
|
315
|
-
writer.write_suspend_thread('*')
|
|
316
|
-
|
|
317
|
-
# Wait for 2 threads to be suspended (the main thread is already in a join, so, it can't actually
|
|
318
|
-
# break out of it while others don't proceed).
|
|
319
|
-
hit0 = writer.wait_for_breakpoint_hit(REASON_THREAD_SUSPEND)
|
|
320
|
-
hit1 = writer.wait_for_breakpoint_hit(REASON_THREAD_SUSPEND)
|
|
321
|
-
|
|
322
|
-
writer.write_evaluate_expression('%s\t%s\t%s' % (hit0.thread_id, hit0.frame_id, 'LOCAL'), 'exit_while_loop(1)')
|
|
323
|
-
writer.wait_for_evaluation([
|
|
324
|
-
[
|
|
325
|
-
'<var name="exit_while_loop(1)" type="str" qualifier="{0}" value="str: ok'.format(builtin_qualifier)
|
|
326
|
-
]
|
|
327
|
-
])
|
|
328
|
-
|
|
329
|
-
writer.write_evaluate_expression('%s\t%s\t%s' % (hit1.thread_id, hit1.frame_id, 'LOCAL'), 'exit_while_loop(2)')
|
|
330
|
-
writer.wait_for_evaluation('<var name="exit_while_loop(2)" type="str" qualifier="{0}" value="str: ok'.format(builtin_qualifier))
|
|
331
|
-
|
|
332
|
-
writer.write_run_thread('*')
|
|
333
|
-
|
|
334
|
-
writer.finished_ok = True
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
def test_case_5(case_setup):
|
|
338
|
-
with case_setup.test_file('_debugger_case56.py') as writer:
|
|
339
|
-
breakpoint_id = writer.write_add_breakpoint(2, 'Call2')
|
|
340
|
-
writer.write_make_initial_run()
|
|
341
|
-
|
|
342
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
343
|
-
thread_id = hit.thread_id
|
|
344
|
-
frame_id = hit.frame_id
|
|
345
|
-
|
|
346
|
-
writer.write_get_frame(thread_id, frame_id)
|
|
347
|
-
|
|
348
|
-
writer.write_remove_breakpoint(breakpoint_id)
|
|
349
|
-
|
|
350
|
-
writer.write_step_return(thread_id)
|
|
351
|
-
|
|
352
|
-
hit = writer.wait_for_breakpoint_hit('109')
|
|
353
|
-
thread_id = hit.thread_id
|
|
354
|
-
frame_id = hit.frame_id
|
|
355
|
-
line = hit.line
|
|
356
|
-
|
|
357
|
-
assert line == 8, 'Expecting it to go to line 8. Went to: %s' % line
|
|
358
|
-
|
|
359
|
-
writer.write_step_in(thread_id)
|
|
360
|
-
|
|
361
|
-
hit = writer.wait_for_breakpoint_hit('107')
|
|
362
|
-
thread_id = hit.thread_id
|
|
363
|
-
frame_id = hit.frame_id
|
|
364
|
-
line = hit.line
|
|
365
|
-
|
|
366
|
-
# goes to line 4 in jython (function declaration line)
|
|
367
|
-
assert line in (4, 5), 'Expecting it to go to line 4 or 5. Went to: %s' % line
|
|
368
|
-
|
|
369
|
-
writer.write_run_thread(thread_id)
|
|
370
|
-
|
|
371
|
-
assert 15 == writer._sequence, 'Expected 15. Had: %s' % writer._sequence
|
|
372
|
-
|
|
373
|
-
writer.finished_ok = True
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
def test_case_6(case_setup):
|
|
377
|
-
with case_setup.test_file('_debugger_case56.py') as writer:
|
|
378
|
-
writer.write_add_breakpoint(2, 'Call2')
|
|
379
|
-
writer.write_make_initial_run()
|
|
380
|
-
|
|
381
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
382
|
-
thread_id = hit.thread_id
|
|
383
|
-
frame_id = hit.frame_id
|
|
384
|
-
|
|
385
|
-
writer.write_get_frame(thread_id, frame_id)
|
|
386
|
-
|
|
387
|
-
writer.write_step_return(thread_id)
|
|
388
|
-
|
|
389
|
-
hit = writer.wait_for_breakpoint_hit('109')
|
|
390
|
-
thread_id = hit.thread_id
|
|
391
|
-
frame_id = hit.frame_id
|
|
392
|
-
line = hit.line
|
|
393
|
-
|
|
394
|
-
assert line == 8, 'Expecting it to go to line 8. Went to: %s' % line
|
|
395
|
-
|
|
396
|
-
writer.write_step_in(thread_id)
|
|
397
|
-
|
|
398
|
-
hit = writer.wait_for_breakpoint_hit('107')
|
|
399
|
-
thread_id = hit.thread_id
|
|
400
|
-
frame_id = hit.frame_id
|
|
401
|
-
line = hit.line
|
|
402
|
-
|
|
403
|
-
# goes to line 4 in jython (function declaration line)
|
|
404
|
-
assert line in (4, 5), 'Expecting it to go to line 4 or 5. Went to: %s' % line
|
|
405
|
-
|
|
406
|
-
writer.write_run_thread(thread_id)
|
|
407
|
-
|
|
408
|
-
assert 13 == writer._sequence, 'Expected 15. Had: %s' % writer._sequence
|
|
409
|
-
|
|
410
|
-
writer.finished_ok = True
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
@pytest.mark.skipif(IS_IRONPYTHON, reason='This test is flaky on Jython, so, skipping it.')
|
|
414
|
-
def test_case_7(case_setup):
|
|
415
|
-
# This test checks that we start without variables and at each step a new var is created, but on ironpython,
|
|
416
|
-
# the variables exist all at once (with None values), so, we can't test it properly.
|
|
417
|
-
with case_setup.test_file('_debugger_case_local_variables.py') as writer:
|
|
418
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('Break here'), 'Call')
|
|
419
|
-
writer.write_make_initial_run()
|
|
420
|
-
|
|
421
|
-
hit = writer.wait_for_breakpoint_hit('111')
|
|
422
|
-
|
|
423
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
424
|
-
|
|
425
|
-
writer.wait_for_vars('<xml></xml>') # no vars at this point
|
|
426
|
-
|
|
427
|
-
writer.write_step_over(hit.thread_id)
|
|
428
|
-
|
|
429
|
-
writer.wait_for_breakpoint_hit('108')
|
|
430
|
-
|
|
431
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
432
|
-
|
|
433
|
-
writer.wait_for_vars([
|
|
434
|
-
[
|
|
435
|
-
'<xml><var name="variable_for_test_1" type="int" qualifier="{0}" value="int%253A 10" />%0A</xml>'.format(builtin_qualifier),
|
|
436
|
-
'<var name="variable_for_test_1" type="int" value="int', # jython
|
|
437
|
-
]
|
|
438
|
-
])
|
|
439
|
-
|
|
440
|
-
writer.write_step_over(hit.thread_id)
|
|
441
|
-
|
|
442
|
-
writer.wait_for_breakpoint_hit('108')
|
|
443
|
-
|
|
444
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
445
|
-
|
|
446
|
-
writer.wait_for_vars([
|
|
447
|
-
[
|
|
448
|
-
'<xml><var name="variable_for_test_1" type="int" qualifier="{0}" value="int%253A 10" />%0A<var name="variable_for_test_2" type="int" qualifier="{0}" value="int%253A 20" />%0A</xml>'.format(builtin_qualifier),
|
|
449
|
-
'<var name="variable_for_test_1" type="int" value="int%253A 10" />%0A<var name="variable_for_test_2" type="int" value="int%253A 20" />%0A', # jython
|
|
450
|
-
]
|
|
451
|
-
])
|
|
452
|
-
|
|
453
|
-
writer.write_run_thread(hit.thread_id)
|
|
454
|
-
|
|
455
|
-
assert 17 == writer._sequence, 'Expected 17. Had: %s' % writer._sequence
|
|
456
|
-
|
|
457
|
-
writer.finished_ok = True
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
def test_case_8(case_setup):
|
|
461
|
-
with case_setup.test_file('_debugger_case89.py') as writer:
|
|
462
|
-
writer.write_add_breakpoint(10, 'Method3')
|
|
463
|
-
writer.write_make_initial_run()
|
|
464
|
-
|
|
465
|
-
hit = writer.wait_for_breakpoint_hit('111')
|
|
466
|
-
|
|
467
|
-
writer.write_step_return(hit.thread_id)
|
|
468
|
-
|
|
469
|
-
hit = writer.wait_for_breakpoint_hit('109', line=15)
|
|
470
|
-
|
|
471
|
-
writer.write_run_thread(hit.thread_id)
|
|
472
|
-
|
|
473
|
-
assert 9 == writer._sequence, 'Expected 9. Had: %s' % writer._sequence
|
|
474
|
-
|
|
475
|
-
writer.finished_ok = True
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
def test_case_9(case_setup):
|
|
479
|
-
with case_setup.test_file('_debugger_case89.py') as writer:
|
|
480
|
-
writer.write_add_breakpoint(10, 'Method3')
|
|
481
|
-
writer.write_make_initial_run()
|
|
482
|
-
|
|
483
|
-
hit = writer.wait_for_breakpoint_hit('111')
|
|
484
|
-
|
|
485
|
-
# Note: no active exception (should not give an error and should return no
|
|
486
|
-
# exception details as there's no exception).
|
|
487
|
-
writer.write_get_current_exception(hit.thread_id)
|
|
488
|
-
|
|
489
|
-
msg = writer.wait_for_message(CMD_GET_EXCEPTION_DETAILS)
|
|
490
|
-
assert msg.thread['id'] == hit.thread_id
|
|
491
|
-
assert not hasattr(msg.thread, 'frames') # No frames should be found.
|
|
492
|
-
|
|
493
|
-
writer.write_step_over(hit.thread_id)
|
|
494
|
-
|
|
495
|
-
hit = writer.wait_for_breakpoint_hit('108', line=11)
|
|
496
|
-
|
|
497
|
-
writer.write_step_over(hit.thread_id)
|
|
498
|
-
|
|
499
|
-
hit = writer.wait_for_breakpoint_hit('108', line=12)
|
|
500
|
-
|
|
501
|
-
writer.write_run_thread(hit.thread_id)
|
|
502
|
-
|
|
503
|
-
assert 13 == writer._sequence, 'Expected 13. Had: %s' % writer._sequence
|
|
504
|
-
|
|
505
|
-
writer.finished_ok = True
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
def test_case_10(case_setup):
|
|
509
|
-
with case_setup.test_file('_debugger_case_simple_calls.py') as writer:
|
|
510
|
-
writer.write_add_breakpoint(2, 'None') # None or Method should make hit.
|
|
511
|
-
writer.write_make_initial_run()
|
|
512
|
-
|
|
513
|
-
hit = writer.wait_for_breakpoint_hit('111')
|
|
514
|
-
|
|
515
|
-
writer.write_step_return(hit.thread_id)
|
|
516
|
-
|
|
517
|
-
hit = writer.wait_for_breakpoint_hit('109', line=11)
|
|
518
|
-
|
|
519
|
-
writer.write_step_over(hit.thread_id)
|
|
520
|
-
|
|
521
|
-
hit = writer.wait_for_breakpoint_hit('108', line=12)
|
|
522
|
-
|
|
523
|
-
writer.write_run_thread(hit.thread_id)
|
|
524
|
-
|
|
525
|
-
assert 11 == writer._sequence, 'Expected 11. Had: %s' % writer._sequence
|
|
526
|
-
|
|
527
|
-
writer.finished_ok = True
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
def test_case_11(case_setup):
|
|
531
|
-
with case_setup.test_file('_debugger_case_simple_calls.py') as writer:
|
|
532
|
-
writer.write_add_breakpoint(2, 'Method1')
|
|
533
|
-
writer.write_make_initial_run()
|
|
534
|
-
|
|
535
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT, line=2)
|
|
536
|
-
assert hit.name == 'Method1'
|
|
537
|
-
|
|
538
|
-
writer.write_step_over(hit.thread_id)
|
|
539
|
-
|
|
540
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STEP_OVER, line=3)
|
|
541
|
-
assert hit.name == 'Method1'
|
|
542
|
-
|
|
543
|
-
writer.write_step_over(hit.thread_id)
|
|
544
|
-
|
|
545
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STEP_OVER, line=12) # Reverts to step in
|
|
546
|
-
assert hit.name == 'Method2'
|
|
547
|
-
|
|
548
|
-
writer.write_step_over(hit.thread_id)
|
|
549
|
-
|
|
550
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STEP_OVER, line=13)
|
|
551
|
-
assert hit.name == 'Method2'
|
|
552
|
-
|
|
553
|
-
writer.write_step_over(hit.thread_id)
|
|
554
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STEP_OVER, line=18) # Reverts to step in
|
|
555
|
-
assert hit.name == '<module>'
|
|
556
|
-
|
|
557
|
-
# Finish with a step over
|
|
558
|
-
writer.write_step_over(hit.thread_id)
|
|
559
|
-
|
|
560
|
-
if IS_JYTHON:
|
|
561
|
-
writer.write_run_thread(hit.thread_id)
|
|
562
|
-
else:
|
|
563
|
-
# Finish with a step over
|
|
564
|
-
writer.write_step_over(hit.thread_id)
|
|
565
|
-
|
|
566
|
-
writer.finished_ok = True
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
def test_case_12(case_setup):
|
|
570
|
-
# Note: In CPython we now ignore the function names, so, we'll stop at the breakpoint in line 2
|
|
571
|
-
# regardless of the function name (we decide whether to stop in a line or not through the function
|
|
572
|
-
# lines).
|
|
573
|
-
with case_setup.test_file('_debugger_case_simple_calls.py') as writer:
|
|
574
|
-
writer.write_add_breakpoint(2, '') # Should not be hit: setting empty function (not None) should only hit global.
|
|
575
|
-
writer.write_add_breakpoint(6, 'Method1a')
|
|
576
|
-
writer.write_add_breakpoint(11, 'Method2')
|
|
577
|
-
writer.write_make_initial_run()
|
|
578
|
-
|
|
579
|
-
hit = writer.wait_for_breakpoint_hit('111', line=11)
|
|
580
|
-
|
|
581
|
-
writer.write_step_return(hit.thread_id)
|
|
582
|
-
|
|
583
|
-
hit = writer.wait_for_breakpoint_hit('111', line=6 if IS_JYTHON else 2) # not a return (it stopped in the other breakpoint)
|
|
584
|
-
|
|
585
|
-
writer.write_run_thread(hit.thread_id)
|
|
586
|
-
|
|
587
|
-
if not IS_JYTHON:
|
|
588
|
-
hit = writer.wait_for_breakpoint_hit('111', line=6)
|
|
589
|
-
|
|
590
|
-
writer.write_run_thread(hit.thread_id)
|
|
591
|
-
|
|
592
|
-
writer.finished_ok = True
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
@pytest.mark.skipif(IS_IRONPYTHON, reason='Failing on IronPython (needs to be investigated).')
|
|
596
|
-
def test_case_13(case_setup):
|
|
597
|
-
with case_setup.test_file('_debugger_case13.py') as writer:
|
|
598
|
-
|
|
599
|
-
def _ignore_stderr_line(line):
|
|
600
|
-
if original_ignore_stderr_line(line):
|
|
601
|
-
return True
|
|
602
|
-
|
|
603
|
-
if IS_JYTHON:
|
|
604
|
-
for expected in (
|
|
605
|
-
"RuntimeWarning: Parent module '_pydevd_bundle' not found while handling absolute import",
|
|
606
|
-
"import __builtin__"):
|
|
607
|
-
if expected in line:
|
|
608
|
-
return True
|
|
609
|
-
|
|
610
|
-
return False
|
|
611
|
-
|
|
612
|
-
original_ignore_stderr_line = writer._ignore_stderr_line
|
|
613
|
-
writer._ignore_stderr_line = _ignore_stderr_line
|
|
614
|
-
|
|
615
|
-
writer.write_add_breakpoint(35, 'main')
|
|
616
|
-
writer.write("%s\t%s\t%s" % (CMD_SET_PROPERTY_TRACE, writer.next_seq(), "true;false;false;true"))
|
|
617
|
-
writer.write_make_initial_run()
|
|
618
|
-
hit = writer.wait_for_breakpoint_hit('111')
|
|
619
|
-
|
|
620
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
621
|
-
|
|
622
|
-
writer.write_step_in(hit.thread_id)
|
|
623
|
-
hit = writer.wait_for_breakpoint_hit('107', line=25)
|
|
624
|
-
# Should go inside setter method
|
|
625
|
-
|
|
626
|
-
writer.write_step_in(hit.thread_id)
|
|
627
|
-
hit = writer.wait_for_breakpoint_hit('107', line=36)
|
|
628
|
-
|
|
629
|
-
writer.write_step_in(hit.thread_id)
|
|
630
|
-
hit = writer.wait_for_breakpoint_hit('107', line=21)
|
|
631
|
-
# Should go inside getter method
|
|
632
|
-
|
|
633
|
-
writer.write_step_in(hit.thread_id)
|
|
634
|
-
hit = writer.wait_for_breakpoint_hit('107')
|
|
635
|
-
|
|
636
|
-
# Disable property tracing
|
|
637
|
-
writer.write("%s\t%s\t%s" % (CMD_SET_PROPERTY_TRACE, writer.next_seq(), "true;true;true;true"))
|
|
638
|
-
writer.write_step_in(hit.thread_id)
|
|
639
|
-
hit = writer.wait_for_breakpoint_hit('107', line=39)
|
|
640
|
-
# Should Skip step into properties setter
|
|
641
|
-
|
|
642
|
-
# Enable property tracing
|
|
643
|
-
writer.write("%s\t%s\t%s" % (CMD_SET_PROPERTY_TRACE, writer.next_seq(), "true;false;false;true"))
|
|
644
|
-
writer.write_step_in(hit.thread_id)
|
|
645
|
-
hit = writer.wait_for_breakpoint_hit('107', line=8)
|
|
646
|
-
# Should go inside getter method
|
|
647
|
-
|
|
648
|
-
writer.write_run_thread(hit.thread_id)
|
|
649
|
-
|
|
650
|
-
writer.finished_ok = True
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
def test_case_14(case_setup):
|
|
654
|
-
# Interactive Debug Console
|
|
655
|
-
with case_setup.test_file('_debugger_case14.py') as writer:
|
|
656
|
-
writer.write_add_breakpoint(22, 'main')
|
|
657
|
-
writer.write_make_initial_run()
|
|
658
|
-
|
|
659
|
-
hit = writer.wait_for_breakpoint_hit('111')
|
|
660
|
-
assert hit.thread_id, '%s not valid.' % hit.thread_id
|
|
661
|
-
assert hit.frame_id, '%s not valid.' % hit.frame_id
|
|
662
|
-
|
|
663
|
-
# Access some variable
|
|
664
|
-
writer.write_debug_console_expression("%s\t%s\tEVALUATE\tcarObj.color" % (hit.thread_id, hit.frame_id))
|
|
665
|
-
writer.wait_for_var(['<more>False</more>', '%27Black%27'])
|
|
666
|
-
assert 7 == writer._sequence, 'Expected 9. Had: %s' % writer._sequence
|
|
667
|
-
|
|
668
|
-
# Change some variable
|
|
669
|
-
writer.write_debug_console_expression("%s\t%s\tEVALUATE\tcarObj.color='Red'" % (hit.thread_id, hit.frame_id))
|
|
670
|
-
writer.write_debug_console_expression("%s\t%s\tEVALUATE\tcarObj.color" % (hit.thread_id, hit.frame_id))
|
|
671
|
-
writer.wait_for_var(['<more>False</more>', '%27Red%27'])
|
|
672
|
-
assert 11 == writer._sequence, 'Expected 13. Had: %s' % writer._sequence
|
|
673
|
-
|
|
674
|
-
# Iterate some loop
|
|
675
|
-
writer.write_debug_console_expression("%s\t%s\tEVALUATE\tfor i in range(3):" % (hit.thread_id, hit.frame_id))
|
|
676
|
-
writer.wait_for_var(['<xml><more>True</more></xml>'])
|
|
677
|
-
writer.write_debug_console_expression("%s\t%s\tEVALUATE\t print(i)" % (hit.thread_id, hit.frame_id))
|
|
678
|
-
writer.wait_for_var(['<xml><more>True</more></xml>'])
|
|
679
|
-
writer.write_debug_console_expression("%s\t%s\tEVALUATE\t" % (hit.thread_id, hit.frame_id))
|
|
680
|
-
writer.wait_for_var(
|
|
681
|
-
[
|
|
682
|
-
'<xml><more>False</more><output message="0"></output><output message="1"></output><output message="2"></output></xml>' ]
|
|
683
|
-
)
|
|
684
|
-
assert 17 == writer._sequence, 'Expected 19. Had: %s' % writer._sequence
|
|
685
|
-
|
|
686
|
-
writer.write_run_thread(hit.thread_id)
|
|
687
|
-
writer.finished_ok = True
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
def test_case_15(case_setup):
|
|
691
|
-
with case_setup.test_file('_debugger_case15.py') as writer:
|
|
692
|
-
writer.write_add_breakpoint(22, 'main')
|
|
693
|
-
writer.write_make_initial_run()
|
|
694
|
-
|
|
695
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT)
|
|
696
|
-
|
|
697
|
-
# Access some variable
|
|
698
|
-
writer.write_custom_operation("%s\t%s\tEXPRESSION\tcarObj.color" % (hit.thread_id, hit.frame_id), "EXEC", "f=lambda x: 'val=%s' % x", "f")
|
|
699
|
-
writer.wait_for_custom_operation('val=Black')
|
|
700
|
-
assert 7 == writer._sequence, 'Expected 7. Had: %s' % writer._sequence
|
|
701
|
-
|
|
702
|
-
writer.write_custom_operation("%s\t%s\tEXPRESSION\tcarObj.color" % (hit.thread_id, hit.frame_id), "EXECFILE", debugger_unittest._get_debugger_test_file('_debugger_case15_execfile.py'), "f")
|
|
703
|
-
writer.wait_for_custom_operation('val=Black')
|
|
704
|
-
assert 9 == writer._sequence, 'Expected 9. Had: %s' % writer._sequence
|
|
705
|
-
|
|
706
|
-
writer.write_run_thread(hit.thread_id)
|
|
707
|
-
writer.finished_ok = True
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
def test_case_16_resolve_numpy_array(case_setup):
|
|
711
|
-
# numpy.ndarray resolver
|
|
712
|
-
try:
|
|
713
|
-
import numpy
|
|
714
|
-
except ImportError:
|
|
715
|
-
pytest.skip('numpy not available')
|
|
716
|
-
with case_setup.test_file('_debugger_case16.py') as writer:
|
|
717
|
-
writer.write_add_breakpoint(9, 'main')
|
|
718
|
-
writer.write_make_initial_run()
|
|
719
|
-
|
|
720
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT)
|
|
721
|
-
|
|
722
|
-
# In this test we check that the three arrays of different shapes, sizes and types
|
|
723
|
-
# are all resolved properly as ndarrays.
|
|
724
|
-
|
|
725
|
-
# First pass check is that we have all three expected variables defined
|
|
726
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
727
|
-
writer.wait_for_multiple_vars((
|
|
728
|
-
(
|
|
729
|
-
'<var name="smallarray" type="ndarray" qualifier="numpy" value="ndarray%253A %255B 0.%252B1.j 1.%252B1.j 2.%252B1.j 3.%252B1.j 4.%252B1.j 5.%252B1.j 6.%252B1.j 7.%252B1.j 8.%252B1.j%250A 9.%252B1.j 10.%252B1.j 11.%252B1.j 12.%252B1.j 13.%252B1.j 14.%252B1.j 15.%252B1.j 16.%252B1.j 17.%252B1.j%250A 18.%252B1.j 19.%252B1.j 20.%252B1.j 21.%252B1.j 22.%252B1.j 23.%252B1.j 24.%252B1.j 25.%252B1.j 26.%252B1.j%250A 27.%252B1.j 28.%252B1.j 29.%252B1.j 30.%252B1.j 31.%252B1.j 32.%252B1.j 33.%252B1.j 34.%252B1.j 35.%252B1.j%250A 36.%252B1.j 37.%252B1.j 38.%252B1.j 39.%252B1.j 40.%252B1.j 41.%252B1.j 42.%252B1.j 43.%252B1.j 44.%252B1.j%250A 45.%252B1.j 46.%252B1.j 47.%252B1.j 48.%252B1.j 49.%252B1.j 50.%252B1.j 51.%252B1.j 52.%252B1.j 53.%252B1.j%250A 54.%252B1.j 55.%252B1.j 56.%252B1.j 57.%252B1.j 58.%252B1.j 59.%252B1.j 60.%252B1.j 61.%252B1.j 62.%252B1.j%250A 63.%252B1.j 64.%252B1.j 65.%252B1.j 66.%252B1.j 67.%252B1.j 68.%252B1.j 69.%252B1.j 70.%252B1.j 71.%252B1.j%250A 72.%252B1.j 73.%252B1.j 74.%252B1.j 75.%252B1.j 76.%252B1.j 77.%252B1.j 78.%252B1.j 79.%252B1.j 80.%252B1.j%250A 81.%252B1.j 82.%252B1.j 83.%252B1.j 84.%252B1.j 85.%252B1.j 86.%252B1.j 87.%252B1.j 88.%252B1.j 89.%252B1.j%250A 90.%252B1.j 91.%252B1.j 92.%252B1.j 93.%252B1.j 94.%252B1.j 95.%252B1.j 96.%252B1.j 97.%252B1.j 98.%252B1.j%250A 99.%252B1.j%255D" isContainer="True" />',
|
|
730
|
-
'<var name="smallarray" type="ndarray" qualifier="numpy" value="ndarray%253A %255B 0.%252B1.j 1.%252B1.j 2.%252B1.j 3.%252B1.j 4.%252B1.j 5.%252B1.j 6.%252B1.j 7.%252B1.j%250A 8.%252B1.j 9.%252B1.j 10.%252B1.j 11.%252B1.j 12.%252B1.j 13.%252B1.j 14.%252B1.j 15.%252B1.j%250A 16.%252B1.j 17.%252B1.j 18.%252B1.j 19.%252B1.j 20.%252B1.j 21.%252B1.j 22.%252B1.j 23.%252B1.j%250A 24.%252B1.j 25.%252B1.j 26.%252B1.j 27.%252B1.j 28.%252B1.j 29.%252B1.j 30.%252B1.j 31.%252B1.j%250A 32.%252B1.j 33.%252B1.j 34.%252B1.j 35.%252B1.j 36.%252B1.j 37.%252B1.j 38.%252B1.j 39.%252B1.j%250A 40.%252B1.j 41.%252B1.j 42.%252B1.j 43.%252B1.j 44.%252B1.j 45.%252B1.j 46.%252B1.j 47.%252B1.j%250A 48.%252B1.j 49.%252B1.j 50.%252B1.j 51.%252B1.j 52.%252B1.j 53.%252B1.j 54.%252B1.j 55.%252B1.j%250A 56.%252B1.j 57.%252B1.j 58.%252B1.j 59.%252B1.j 60.%252B1.j 61.%252B1.j 62.%252B1.j 63.%252B1.j%250A 64.%252B1.j 65.%252B1.j 66.%252B1.j 67.%252B1.j 68.%252B1.j 69.%252B1.j 70.%252B1.j 71.%252B1.j%250A 72.%252B1.j 73.%252B1.j 74.%252B1.j 75.%252B1.j 76.%252B1.j 77.%252B1.j 78.%252B1.j 79.%252B1.j%250A 80.%252B1.j 81.%252B1.j 82.%252B1.j 83.%252B1.j 84.%252B1.j 85.%252B1.j 86.%252B1.j 87.%252B1.j%250A 88.%252B1.j 89.%252B1.j 90.%252B1.j 91.%252B1.j 92.%252B1.j 93.%252B1.j 94.%252B1.j 95.%252B1.j%250A 96.%252B1.j 97.%252B1.j 98.%252B1.j 99.%252B1.j%255D" isContainer="True" />'
|
|
731
|
-
),
|
|
732
|
-
|
|
733
|
-
(
|
|
734
|
-
'<var name="bigarray" type="ndarray" qualifier="numpy" value="ndarray%253A %255B%255B 0 1 2 ... 9997 9998 9999%255D%250A %255B10000 10001 10002 ... 19997 19998 19999%255D%250A %255B20000 20001 20002 ... 29997 29998 29999%255D%250A ...%250A %255B70000 70001 70002 ... 79997 79998 79999%255D%250A %255B80000 80001 80002 ... 89997 89998 89999%255D%250A %255B90000 90001 90002 ... 99997 99998 99999%255D%255D" isContainer="True" />',
|
|
735
|
-
'<var name="bigarray" type="ndarray" qualifier="numpy" value="ndarray%253A %255B%255B 0 1 2 ...%252C 9997 9998 9999%255D%250A %255B10000 10001 10002 ...%252C 19997 19998 19999%255D%250A %255B20000 20001 20002 ...%252C 29997 29998 29999%255D%250A ...%252C %250A %255B70000 70001 70002 ...%252C 79997 79998 79999%255D%250A %255B80000 80001 80002 ...%252C 89997 89998 89999%255D%250A %255B90000 90001 90002 ...%252C 99997 99998 99999%255D%255D" isContainer="True" />'
|
|
736
|
-
),
|
|
737
|
-
|
|
738
|
-
# Any of the ones below will do.
|
|
739
|
-
(
|
|
740
|
-
'<var name="hugearray" type="ndarray" qualifier="numpy" value="ndarray%253A %255B 0 1 2 ... 9999997 9999998 9999999%255D" isContainer="True" />',
|
|
741
|
-
'<var name="hugearray" type="ndarray" qualifier="numpy" value="ndarray%253A %255B 0 1 2 ...%252C 9999997 9999998 9999999%255D" isContainer="True" />'
|
|
742
|
-
)
|
|
743
|
-
))
|
|
744
|
-
|
|
745
|
-
# For each variable, check each of the resolved (meta data) attributes...
|
|
746
|
-
writer.write_get_variable(hit.thread_id, hit.frame_id, 'smallarray')
|
|
747
|
-
writer.wait_for_multiple_vars((
|
|
748
|
-
'<var name="min" type="complex128"',
|
|
749
|
-
'<var name="max" type="complex128"',
|
|
750
|
-
'<var name="shape" type="tuple"',
|
|
751
|
-
'<var name="dtype" type="dtype',
|
|
752
|
-
'<var name="size" type="int"',
|
|
753
|
-
))
|
|
754
|
-
# ...and check that the internals are resolved properly
|
|
755
|
-
writer.write_get_variable(hit.thread_id, hit.frame_id, 'smallarray\t__internals__')
|
|
756
|
-
writer.wait_for_var('<var name="%27size%27')
|
|
757
|
-
|
|
758
|
-
writer.write_get_variable(hit.thread_id, hit.frame_id, 'bigarray')
|
|
759
|
-
# isContainer could be true on some numpy versions, so, we only check for the var begin.
|
|
760
|
-
writer.wait_for_multiple_vars((
|
|
761
|
-
[
|
|
762
|
-
'<var name="min" type="int64" qualifier="numpy" value="int64%253A 0"',
|
|
763
|
-
'<var name="min" type="int64" qualifier="numpy" value="int64%3A 0"',
|
|
764
|
-
'<var name="size" type="int" qualifier="{0}" value="int%3A 100000"'.format(builtin_qualifier),
|
|
765
|
-
],
|
|
766
|
-
[
|
|
767
|
-
'<var name="max" type="int64" qualifier="numpy" value="int64%253A 99999"',
|
|
768
|
-
'<var name="max" type="int32" qualifier="numpy" value="int32%253A 99999"',
|
|
769
|
-
'<var name="max" type="int64" qualifier="numpy" value="int64%3A 99999"',
|
|
770
|
-
'<var name="max" type="int32" qualifier="numpy" value="int32%253A 99999"',
|
|
771
|
-
],
|
|
772
|
-
'<var name="shape" type="tuple"',
|
|
773
|
-
'<var name="dtype" type="dtype',
|
|
774
|
-
'<var name="size" type="int"'
|
|
775
|
-
))
|
|
776
|
-
writer.write_get_variable(hit.thread_id, hit.frame_id, 'bigarray\t__internals__')
|
|
777
|
-
writer.wait_for_var('<var name="%27size%27')
|
|
778
|
-
|
|
779
|
-
# this one is different because it crosses the magic threshold where we don't calculate
|
|
780
|
-
# the min/max
|
|
781
|
-
writer.write_get_variable(hit.thread_id, hit.frame_id, 'hugearray')
|
|
782
|
-
writer.wait_for_var((
|
|
783
|
-
[
|
|
784
|
-
'<var name="min" type="str" qualifier={0} value="str%253A ndarray too big%252C calculating min would slow down debugging" />'.format(builtin_qualifier),
|
|
785
|
-
'<var name="min" type="str" qualifier={0} value="str%3A ndarray too big%252C calculating min would slow down debugging" />'.format(builtin_qualifier),
|
|
786
|
-
'<var name="min" type="str" qualifier="{0}" value="str%253A ndarray too big%252C calculating min would slow down debugging" />'.format(builtin_qualifier),
|
|
787
|
-
'<var name="min" type="str" qualifier="{0}" value="str%3A ndarray too big%252C calculating min would slow down debugging" />'.format(builtin_qualifier),
|
|
788
|
-
],
|
|
789
|
-
[
|
|
790
|
-
'<var name="max" type="str" qualifier={0} value="str%253A ndarray too big%252C calculating max would slow down debugging" />'.format(builtin_qualifier),
|
|
791
|
-
'<var name="max" type="str" qualifier={0} value="str%3A ndarray too big%252C calculating max would slow down debugging" />'.format(builtin_qualifier),
|
|
792
|
-
'<var name="max" type="str" qualifier="{0}" value="str%253A ndarray too big%252C calculating max would slow down debugging" />'.format(builtin_qualifier),
|
|
793
|
-
'<var name="max" type="str" qualifier="{0}" value="str%3A ndarray too big%252C calculating max would slow down debugging" />'.format(builtin_qualifier),
|
|
794
|
-
],
|
|
795
|
-
'<var name="shape" type="tuple"',
|
|
796
|
-
'<var name="dtype" type="dtype',
|
|
797
|
-
'<var name="size" type="int"',
|
|
798
|
-
))
|
|
799
|
-
writer.write_get_variable(hit.thread_id, hit.frame_id, 'hugearray\t__internals__')
|
|
800
|
-
writer.wait_for_var('<var name="%27size%27')
|
|
801
|
-
|
|
802
|
-
writer.write_run_thread(hit.thread_id)
|
|
803
|
-
writer.finished_ok = True
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
def test_case_17(case_setup):
|
|
807
|
-
# Check dont trace
|
|
808
|
-
with case_setup.test_file('_debugger_case17.py') as writer:
|
|
809
|
-
writer.write_enable_dont_trace(True)
|
|
810
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break1'), 'main')
|
|
811
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break2'), 'main')
|
|
812
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break3'), 'main')
|
|
813
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break4'), 'main')
|
|
814
|
-
writer.write_make_initial_run()
|
|
815
|
-
|
|
816
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT)
|
|
817
|
-
writer.write_step_in(hit.thread_id)
|
|
818
|
-
hit = writer.wait_for_breakpoint_hit('107', line=2)
|
|
819
|
-
# Should Skip step into properties setter
|
|
820
|
-
writer.write_run_thread(hit.thread_id)
|
|
821
|
-
|
|
822
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT)
|
|
823
|
-
writer.write_step_in(hit.thread_id)
|
|
824
|
-
hit = writer.wait_for_breakpoint_hit('107', line=2)
|
|
825
|
-
# Should Skip step into properties setter
|
|
826
|
-
writer.write_run_thread(hit.thread_id)
|
|
827
|
-
|
|
828
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT)
|
|
829
|
-
writer.write_step_in(hit.thread_id)
|
|
830
|
-
hit = writer.wait_for_breakpoint_hit('107', line=2)
|
|
831
|
-
# Should Skip step into properties setter
|
|
832
|
-
writer.write_run_thread(hit.thread_id)
|
|
833
|
-
|
|
834
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT)
|
|
835
|
-
writer.write_step_in(hit.thread_id)
|
|
836
|
-
hit = writer.wait_for_breakpoint_hit('107', line=2)
|
|
837
|
-
# Should Skip step into properties setter
|
|
838
|
-
writer.write_run_thread(hit.thread_id)
|
|
839
|
-
|
|
840
|
-
writer.finished_ok = True
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
def test_case_17a(case_setup):
|
|
844
|
-
# Check dont trace return
|
|
845
|
-
with case_setup.test_file('_debugger_case17a.py') as writer:
|
|
846
|
-
writer.write_enable_dont_trace(True)
|
|
847
|
-
break1_line = writer.get_line_index_with_content('break 1 here')
|
|
848
|
-
writer.write_add_breakpoint(break1_line, 'm1')
|
|
849
|
-
writer.write_make_initial_run()
|
|
850
|
-
|
|
851
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT, line=break1_line)
|
|
852
|
-
|
|
853
|
-
writer.write_step_in(hit.thread_id)
|
|
854
|
-
break2_line = writer.get_line_index_with_content('break 2 here')
|
|
855
|
-
hit = writer.wait_for_breakpoint_hit('107', line=break2_line)
|
|
856
|
-
|
|
857
|
-
# Should Skip step into properties setter
|
|
858
|
-
assert hit.name == 'm3'
|
|
859
|
-
writer.write_run_thread(hit.thread_id)
|
|
860
|
-
|
|
861
|
-
writer.finished_ok = True
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
def test_case_18(case_setup):
|
|
865
|
-
# change local variable
|
|
866
|
-
if IS_IRONPYTHON or IS_JYTHON:
|
|
867
|
-
pytest.skip('Unsupported assign to local')
|
|
868
|
-
|
|
869
|
-
with case_setup.test_file('_debugger_case18.py') as writer:
|
|
870
|
-
writer.write_add_breakpoint(5, 'm2')
|
|
871
|
-
writer.write_make_initial_run()
|
|
872
|
-
|
|
873
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT, line=5)
|
|
874
|
-
|
|
875
|
-
writer.write_change_variable(hit.thread_id, hit.frame_id, 'a', '40')
|
|
876
|
-
writer.wait_for_var('<xml><var name="" type="int" qualifier="{0}" value="int%253A 40" />%0A</xml>'.format(builtin_qualifier,))
|
|
877
|
-
writer.write_run_thread(hit.thread_id)
|
|
878
|
-
|
|
879
|
-
writer.finished_ok = True
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
def test_case_19(case_setup):
|
|
883
|
-
# Check evaluate '__' attributes
|
|
884
|
-
with case_setup.test_file('_debugger_case19.py') as writer:
|
|
885
|
-
writer.write_add_breakpoint(8, None)
|
|
886
|
-
writer.write_make_initial_run()
|
|
887
|
-
|
|
888
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT, line=8)
|
|
889
|
-
|
|
890
|
-
writer.write_evaluate_expression('%s\t%s\t%s' % (hit.thread_id, hit.frame_id, 'LOCAL'), 'a.__var')
|
|
891
|
-
writer.wait_for_evaluation([
|
|
892
|
-
[
|
|
893
|
-
'<var name="a.__var" type="int" qualifier="{0}" value="int'.format(builtin_qualifier),
|
|
894
|
-
'<var name="a.__var" type="int" value="int', # jython
|
|
895
|
-
]
|
|
896
|
-
])
|
|
897
|
-
writer.write_run_thread(hit.thread_id)
|
|
898
|
-
|
|
899
|
-
writer.finished_ok = True
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Monkey-patching related to starting threads not done on Jython.')
|
|
903
|
-
def test_case_20(case_setup):
|
|
904
|
-
# Check that we were notified of threads creation before they started to run
|
|
905
|
-
with case_setup.test_file('_debugger_case20.py') as writer:
|
|
906
|
-
writer.write_make_initial_run()
|
|
907
|
-
|
|
908
|
-
# We already check if it prints 'TEST SUCEEDED' by default, so, nothing
|
|
909
|
-
# else should be needed in this test as it tests what's needed just by
|
|
910
|
-
# running the module.
|
|
911
|
-
writer.finished_ok = True
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
@pytest.mark.skipif(not TEST_FLASK, reason='No flask available')
|
|
915
|
-
def test_case_flask(case_setup_flask):
|
|
916
|
-
with case_setup_flask.test_file(EXPECTED_RETURNCODE='any') as writer:
|
|
917
|
-
writer.write_multi_threads_single_notification(True)
|
|
918
|
-
writer.write_add_breakpoint_jinja2(5, None, 'hello.html')
|
|
919
|
-
writer.write_add_breakpoint_jinja2(8, None, 'hello.html')
|
|
920
|
-
writer.write_make_initial_run()
|
|
921
|
-
|
|
922
|
-
t = writer.create_request_thread()
|
|
923
|
-
time.sleep(2) # Give flask some time to get to startup before requesting the page
|
|
924
|
-
t.start()
|
|
925
|
-
|
|
926
|
-
hit = writer.wait_for_single_notification_as_hit(line=5)
|
|
927
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
928
|
-
writer.wait_for_vars(['<var name="content" type="str"'])
|
|
929
|
-
writer.write_run_thread(hit.thread_id)
|
|
930
|
-
|
|
931
|
-
hit = writer.wait_for_single_notification_as_hit(line=8)
|
|
932
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
933
|
-
writer.wait_for_vars(['<var name="content" type="str"'])
|
|
934
|
-
writer.write_run_thread(hit.thread_id)
|
|
935
|
-
|
|
936
|
-
contents = t.wait_for_contents()
|
|
937
|
-
|
|
938
|
-
assert '<title>Hello</title>' in contents
|
|
939
|
-
assert 'Flask-Jinja-Test' in contents
|
|
940
|
-
|
|
941
|
-
writer.finished_ok = True
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
@pytest.mark.skipif(not TEST_DJANGO, reason='No django available')
|
|
945
|
-
def test_case_django_a(case_setup_django):
|
|
946
|
-
|
|
947
|
-
def get_environ(writer):
|
|
948
|
-
env = os.environ.copy()
|
|
949
|
-
env.update({
|
|
950
|
-
'PYDEVD_FILTER_LIBRARIES': '1', # Global setting for in project or not
|
|
951
|
-
})
|
|
952
|
-
return env
|
|
953
|
-
|
|
954
|
-
with case_setup_django.test_file(EXPECTED_RETURNCODE='any', get_environ=get_environ) as writer:
|
|
955
|
-
writer.write_make_initial_run()
|
|
956
|
-
|
|
957
|
-
# Wait for the first request that works...
|
|
958
|
-
for i in range(4):
|
|
959
|
-
try:
|
|
960
|
-
t = writer.create_request_thread('my_app')
|
|
961
|
-
t.start()
|
|
962
|
-
contents = t.wait_for_contents()
|
|
963
|
-
contents = contents.replace(' ', '').replace('\r', '').replace('\n', '')
|
|
964
|
-
assert contents == '<ul><li>v1:v1</li><li>v2:v2</li></ul>'
|
|
965
|
-
break
|
|
966
|
-
except:
|
|
967
|
-
if i == 3:
|
|
968
|
-
raise
|
|
969
|
-
continue
|
|
970
|
-
|
|
971
|
-
writer.write_add_breakpoint_django(5, None, 'index.html')
|
|
972
|
-
t = writer.create_request_thread('my_app')
|
|
973
|
-
t.start()
|
|
974
|
-
|
|
975
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT, line=5)
|
|
976
|
-
writer.write_get_variable(hit.thread_id, hit.frame_id, 'entry')
|
|
977
|
-
writer.wait_for_vars([
|
|
978
|
-
'<var name="key" type="str"',
|
|
979
|
-
'v1'
|
|
980
|
-
])
|
|
981
|
-
|
|
982
|
-
writer.write_run_thread(hit.thread_id)
|
|
983
|
-
|
|
984
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT, line=5)
|
|
985
|
-
writer.write_get_variable(hit.thread_id, hit.frame_id, 'entry')
|
|
986
|
-
writer.wait_for_vars([
|
|
987
|
-
'<var name="key" type="str"',
|
|
988
|
-
'v2'
|
|
989
|
-
])
|
|
990
|
-
|
|
991
|
-
writer.write_run_thread(hit.thread_id)
|
|
992
|
-
|
|
993
|
-
contents = t.wait_for_contents()
|
|
994
|
-
|
|
995
|
-
contents = contents.replace(' ', '').replace('\r', '').replace('\n', '')
|
|
996
|
-
if contents != '<ul><li>v1:v1</li><li>v2:v2</li></ul>':
|
|
997
|
-
raise AssertionError('%s != <ul><li>v1:v1</li><li>v2:v2</li></ul>' % (contents,))
|
|
998
|
-
|
|
999
|
-
writer.finished_ok = True
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
@pytest.mark.skipif(not TEST_DJANGO, reason='No django available')
|
|
1003
|
-
def test_case_django_b(case_setup_django):
|
|
1004
|
-
with case_setup_django.test_file(EXPECTED_RETURNCODE='any') as writer:
|
|
1005
|
-
writer.write_add_breakpoint_django(4, None, 'name.html')
|
|
1006
|
-
writer.write_add_exception_breakpoint_django()
|
|
1007
|
-
writer.write_remove_exception_breakpoint_django()
|
|
1008
|
-
writer.write_make_initial_run()
|
|
1009
|
-
|
|
1010
|
-
t = writer.create_request_thread('my_app/name')
|
|
1011
|
-
time.sleep(5) # Give django some time to get to startup before requesting the page
|
|
1012
|
-
t.start()
|
|
1013
|
-
|
|
1014
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT, line=4)
|
|
1015
|
-
|
|
1016
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
1017
|
-
writer.wait_for_var('<var name="form" type="NameForm" qualifier="my_app.forms" value="NameForm%253A')
|
|
1018
|
-
writer.write_run_thread(hit.thread_id)
|
|
1019
|
-
writer.finished_ok = True
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
@pytest.mark.skipif(not TEST_DJANGO, reason='No django available')
|
|
1023
|
-
def test_case_django_template_inherits_no_exception(case_setup_django):
|
|
1024
|
-
with case_setup_django.test_file(EXPECTED_RETURNCODE='any') as writer:
|
|
1025
|
-
|
|
1026
|
-
# Check that it doesn't have issues with inherits + django exception breakpoints.
|
|
1027
|
-
writer.write_add_exception_breakpoint_django()
|
|
1028
|
-
|
|
1029
|
-
writer.write_make_initial_run()
|
|
1030
|
-
|
|
1031
|
-
t = writer.create_request_thread('my_app/inherits')
|
|
1032
|
-
time.sleep(5) # Give django some time to get to startup before requesting the page
|
|
1033
|
-
t.start()
|
|
1034
|
-
contents = t.wait_for_contents()
|
|
1035
|
-
|
|
1036
|
-
contents = contents.replace(' ', '').replace('\r', '').replace('\n', '')
|
|
1037
|
-
assert contents == '''"chat_mode=True""chat_mode=False"'''
|
|
1038
|
-
|
|
1039
|
-
writer.finished_ok = True
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
@pytest.mark.skipif(not TEST_DJANGO, reason='No django available')
|
|
1043
|
-
def test_case_django_no_var_error(case_setup_django):
|
|
1044
|
-
with case_setup_django.test_file(EXPECTED_RETURNCODE='any') as writer:
|
|
1045
|
-
|
|
1046
|
-
# Check that it doesn't have issues with inherits + django exception breakpoints.
|
|
1047
|
-
writer.write_add_exception_breakpoint_django()
|
|
1048
|
-
|
|
1049
|
-
writer.write_make_initial_run()
|
|
1050
|
-
|
|
1051
|
-
t = writer.create_request_thread('my_app/no_var_error')
|
|
1052
|
-
time.sleep(5) # Give django some time to get to startup before requesting the page
|
|
1053
|
-
t.start()
|
|
1054
|
-
contents = t.wait_for_contents()
|
|
1055
|
-
|
|
1056
|
-
contents = contents.replace(' ', '').replace('\r', '').replace('\n', '')
|
|
1057
|
-
assert contents == '''no_pat_name'''
|
|
1058
|
-
|
|
1059
|
-
writer.finished_ok = True
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
@pytest.mark.skipif(not TEST_DJANGO, reason='No django available')
|
|
1063
|
-
@pytest.mark.parametrize("jmc", [False, True])
|
|
1064
|
-
def test_case_django_no_attribute_exception_breakpoint(case_setup_django, jmc):
|
|
1065
|
-
kwargs = {}
|
|
1066
|
-
if jmc:
|
|
1067
|
-
|
|
1068
|
-
def get_environ(writer):
|
|
1069
|
-
env = os.environ.copy()
|
|
1070
|
-
env.update({
|
|
1071
|
-
'PYDEVD_FILTER_LIBRARIES': '1', # Global setting for in project or not
|
|
1072
|
-
})
|
|
1073
|
-
return env
|
|
1074
|
-
|
|
1075
|
-
kwargs['get_environ'] = get_environ
|
|
1076
|
-
|
|
1077
|
-
with case_setup_django.test_file(EXPECTED_RETURNCODE='any', **kwargs) as writer:
|
|
1078
|
-
writer.write_add_exception_breakpoint_django()
|
|
1079
|
-
|
|
1080
|
-
writer.write_make_initial_run()
|
|
1081
|
-
|
|
1082
|
-
t = writer.create_request_thread('my_app/template_error')
|
|
1083
|
-
time.sleep(5) # Give django some time to get to startup before requesting the page
|
|
1084
|
-
t.start()
|
|
1085
|
-
|
|
1086
|
-
hit = writer.wait_for_breakpoint_hit(REASON_CAUGHT_EXCEPTION, line=7, file='template_error.html')
|
|
1087
|
-
|
|
1088
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
1089
|
-
writer.wait_for_var('<var name="entry" type="Entry" qualifier="my_app.views" value="Entry: v1:v1" isContainer="True"')
|
|
1090
|
-
|
|
1091
|
-
writer.write_run_thread(hit.thread_id)
|
|
1092
|
-
writer.finished_ok = True
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
@pytest.mark.skipif(not TEST_DJANGO, reason='No django available')
|
|
1096
|
-
def test_case_django_no_attribute_exception_breakpoint_and_regular_exceptions(case_setup_django):
|
|
1097
|
-
with case_setup_django.test_file(EXPECTED_RETURNCODE='any') as writer:
|
|
1098
|
-
writer.write_add_exception_breakpoint_django()
|
|
1099
|
-
|
|
1100
|
-
# The django plugin has priority over the regular exception breakpoint.
|
|
1101
|
-
writer.write_add_exception_breakpoint_with_policy(
|
|
1102
|
-
'django.template.base.VariableDoesNotExist',
|
|
1103
|
-
notify_on_handled_exceptions=2, # 2 means notify only on first raise.
|
|
1104
|
-
notify_on_unhandled_exceptions=0,
|
|
1105
|
-
ignore_libraries=0
|
|
1106
|
-
)
|
|
1107
|
-
writer.write_make_initial_run()
|
|
1108
|
-
|
|
1109
|
-
t = writer.create_request_thread('my_app/template_error')
|
|
1110
|
-
time.sleep(5) # Give django some time to get to startup before requesting the page
|
|
1111
|
-
t.start()
|
|
1112
|
-
|
|
1113
|
-
hit = writer.wait_for_breakpoint_hit(REASON_CAUGHT_EXCEPTION, line=7, file='template_error.html')
|
|
1114
|
-
|
|
1115
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
1116
|
-
writer.wait_for_var('<var name="entry" type="Entry" qualifier="my_app.views" value="Entry: v1:v1" isContainer="True"')
|
|
1117
|
-
|
|
1118
|
-
writer.write_run_thread(hit.thread_id)
|
|
1119
|
-
writer.finished_ok = True
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
@pytest.mark.skipif(not TEST_DJANGO, reason='No django available')
|
|
1123
|
-
@pytest.mark.parametrize("jmc", [False, True])
|
|
1124
|
-
def test_case_django_invalid_template_exception_breakpoint(case_setup_django, jmc):
|
|
1125
|
-
kwargs = {}
|
|
1126
|
-
if jmc:
|
|
1127
|
-
|
|
1128
|
-
def get_environ(writer):
|
|
1129
|
-
env = os.environ.copy()
|
|
1130
|
-
env.update({
|
|
1131
|
-
'PYDEVD_FILTER_LIBRARIES': '1', # Global setting for in project or not
|
|
1132
|
-
})
|
|
1133
|
-
return env
|
|
1134
|
-
|
|
1135
|
-
kwargs['get_environ'] = get_environ
|
|
1136
|
-
|
|
1137
|
-
with case_setup_django.test_file(EXPECTED_RETURNCODE='any', **kwargs) as writer:
|
|
1138
|
-
writer.write_add_exception_breakpoint_django()
|
|
1139
|
-
writer.write_make_initial_run()
|
|
1140
|
-
|
|
1141
|
-
t = writer.create_request_thread('my_app/template_error2')
|
|
1142
|
-
time.sleep(5) # Give django some time to get to startup before requesting the page
|
|
1143
|
-
t.start()
|
|
1144
|
-
|
|
1145
|
-
hit = writer.wait_for_breakpoint_hit(REASON_CAUGHT_EXCEPTION, line=4, file='template_error2.html')
|
|
1146
|
-
|
|
1147
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
1148
|
-
writer.wait_for_var('<var name="token" type="Token" qualifier="django.template.base" value="Token:')
|
|
1149
|
-
|
|
1150
|
-
writer.write_run_thread(hit.thread_id)
|
|
1151
|
-
writer.finished_ok = True
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
@pytest.mark.skipif(not TEST_CYTHON, reason='No cython available')
|
|
1155
|
-
def test_cython(case_setup):
|
|
1156
|
-
from _pydevd_bundle import pydevd_cython
|
|
1157
|
-
assert pydevd_cython.trace_dispatch is not None
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
def _has_qt():
|
|
1161
|
-
try:
|
|
1162
|
-
try:
|
|
1163
|
-
from PySide import QtCore # @UnresolvedImport
|
|
1164
|
-
return True
|
|
1165
|
-
except:
|
|
1166
|
-
from PySide2 import QtCore # @UnresolvedImport
|
|
1167
|
-
return True
|
|
1168
|
-
except:
|
|
1169
|
-
try:
|
|
1170
|
-
from PyQt4 import QtCore # @UnresolvedImport
|
|
1171
|
-
return True
|
|
1172
|
-
except:
|
|
1173
|
-
try:
|
|
1174
|
-
from PyQt5 import QtCore # @UnresolvedImport
|
|
1175
|
-
return True
|
|
1176
|
-
except:
|
|
1177
|
-
pass
|
|
1178
|
-
return False
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
@pytest.mark.skipif(not _has_qt(), reason='No qt available')
|
|
1182
|
-
def test_case_qthread1(case_setup):
|
|
1183
|
-
with case_setup.test_file('_debugger_case_qthread1.py') as writer:
|
|
1184
|
-
breakpoint_id = writer.write_add_breakpoint(writer.get_line_index_with_content('break here'), 'run')
|
|
1185
|
-
writer.write_make_initial_run()
|
|
1186
|
-
|
|
1187
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
1188
|
-
|
|
1189
|
-
writer.write_remove_breakpoint(breakpoint_id)
|
|
1190
|
-
writer.write_run_thread(hit.thread_id)
|
|
1191
|
-
|
|
1192
|
-
writer.log.append('Checking sequence. Found: %s' % (writer._sequence))
|
|
1193
|
-
assert 9 == writer._sequence, 'Expected 9. Had: %s' % writer._sequence
|
|
1194
|
-
|
|
1195
|
-
writer.log.append('Marking finished ok.')
|
|
1196
|
-
writer.finished_ok = True
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
@pytest.mark.skipif(not _has_qt(), reason='No qt available')
|
|
1200
|
-
def test_case_qthread2(case_setup):
|
|
1201
|
-
with case_setup.test_file('_debugger_case_qthread2.py') as writer:
|
|
1202
|
-
breakpoint_id = writer.write_add_breakpoint(writer.get_line_index_with_content('break here'), 'long_running')
|
|
1203
|
-
writer.write_make_initial_run()
|
|
1204
|
-
|
|
1205
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
1206
|
-
thread_id = hit.thread_id
|
|
1207
|
-
|
|
1208
|
-
writer.write_remove_breakpoint(breakpoint_id)
|
|
1209
|
-
writer.write_run_thread(thread_id)
|
|
1210
|
-
|
|
1211
|
-
writer.log.append('Checking sequence. Found: %s' % (writer._sequence))
|
|
1212
|
-
assert 9 == writer._sequence, 'Expected 9. Had: %s' % writer._sequence
|
|
1213
|
-
|
|
1214
|
-
writer.log.append('Marking finished ok.')
|
|
1215
|
-
writer.finished_ok = True
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
@pytest.mark.skipif(not _has_qt(), reason='No qt available')
|
|
1219
|
-
def test_case_qthread3(case_setup):
|
|
1220
|
-
with case_setup.test_file('_debugger_case_qthread3.py') as writer:
|
|
1221
|
-
breakpoint_id = writer.write_add_breakpoint(writer.get_line_index_with_content('break here'), 'run')
|
|
1222
|
-
writer.write_make_initial_run()
|
|
1223
|
-
|
|
1224
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
1225
|
-
thread_id = hit.thread_id
|
|
1226
|
-
frame_id = hit.frame_id
|
|
1227
|
-
|
|
1228
|
-
writer.write_remove_breakpoint(breakpoint_id)
|
|
1229
|
-
writer.write_run_thread(thread_id)
|
|
1230
|
-
|
|
1231
|
-
writer.log.append('Checking sequence. Found: %s' % (writer._sequence))
|
|
1232
|
-
assert 9 == writer._sequence, 'Expected 9. Had: %s' % writer._sequence
|
|
1233
|
-
|
|
1234
|
-
writer.log.append('Marking finished ok.')
|
|
1235
|
-
writer.finished_ok = True
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
@pytest.mark.skipif(not _has_qt(), reason='No qt available')
|
|
1239
|
-
def test_case_qthread4(case_setup):
|
|
1240
|
-
with case_setup.test_file('_debugger_case_qthread4.py') as writer:
|
|
1241
|
-
original_additional_output_checks = writer.additional_output_checks
|
|
1242
|
-
|
|
1243
|
-
def additional_output_checks(stdout, stderr):
|
|
1244
|
-
original_additional_output_checks(stdout, stderr)
|
|
1245
|
-
if 'On start called' not in stdout:
|
|
1246
|
-
raise AssertionError('Expected "On start called" to be in stdout:\n%s' % (stdout,))
|
|
1247
|
-
if 'Done sleeping' not in stdout:
|
|
1248
|
-
raise AssertionError('Expected "Done sleeping" to be in stdout:\n%s' % (stdout,))
|
|
1249
|
-
if 'native Qt signal is not callable' in stderr:
|
|
1250
|
-
raise AssertionError('Did not expect "native Qt signal is not callable" to be in stderr:\n%s' % (stderr,))
|
|
1251
|
-
|
|
1252
|
-
breakpoint_id = writer.write_add_breakpoint(28, 'on_start') # breakpoint on print('On start called2').
|
|
1253
|
-
writer.write_make_initial_run()
|
|
1254
|
-
|
|
1255
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
1256
|
-
|
|
1257
|
-
writer.write_remove_breakpoint(breakpoint_id)
|
|
1258
|
-
writer.write_run_thread(hit.thread_id)
|
|
1259
|
-
|
|
1260
|
-
writer.log.append('Checking sequence. Found: %s' % (writer._sequence))
|
|
1261
|
-
assert 9 == writer._sequence, 'Expected 9. Had: %s' % writer._sequence
|
|
1262
|
-
|
|
1263
|
-
writer.log.append('Marking finished ok.')
|
|
1264
|
-
writer.finished_ok = True
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
def test_m_switch(case_setup_m_switch):
|
|
1268
|
-
with case_setup_m_switch.test_file() as writer:
|
|
1269
|
-
writer.log.append('writing add breakpoint')
|
|
1270
|
-
breakpoint_id = writer.write_add_breakpoint(1, None)
|
|
1271
|
-
|
|
1272
|
-
writer.log.append('making initial run')
|
|
1273
|
-
writer.write_make_initial_run()
|
|
1274
|
-
|
|
1275
|
-
writer.log.append('waiting for breakpoint hit')
|
|
1276
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
1277
|
-
|
|
1278
|
-
writer.write_remove_breakpoint(breakpoint_id)
|
|
1279
|
-
|
|
1280
|
-
writer.log.append('run thread')
|
|
1281
|
-
writer.write_run_thread(hit.thread_id)
|
|
1282
|
-
|
|
1283
|
-
writer.log.append('asserting')
|
|
1284
|
-
try:
|
|
1285
|
-
assert 9 == writer._sequence, 'Expected 9. Had: %s' % writer._sequence
|
|
1286
|
-
except:
|
|
1287
|
-
writer.log.append('assert failed!')
|
|
1288
|
-
raise
|
|
1289
|
-
writer.log.append('asserted')
|
|
1290
|
-
|
|
1291
|
-
writer.finished_ok = True
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
def test_module_entry_point(case_setup_m_switch_entry_point):
|
|
1295
|
-
with case_setup_m_switch_entry_point.test_file() as writer:
|
|
1296
|
-
writer.log.append('writing add breakpoint')
|
|
1297
|
-
breakpoint_id = writer.write_add_breakpoint(1, None)
|
|
1298
|
-
|
|
1299
|
-
writer.log.append('making initial run')
|
|
1300
|
-
writer.write_make_initial_run()
|
|
1301
|
-
|
|
1302
|
-
writer.log.append('waiting for breakpoint hit')
|
|
1303
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
1304
|
-
|
|
1305
|
-
writer.write_remove_breakpoint(breakpoint_id)
|
|
1306
|
-
|
|
1307
|
-
writer.log.append('run thread')
|
|
1308
|
-
writer.write_run_thread(hit.thread_id)
|
|
1309
|
-
|
|
1310
|
-
writer.log.append('asserting')
|
|
1311
|
-
try:
|
|
1312
|
-
assert 9 == writer._sequence, 'Expected 9. Had: %s' % writer._sequence
|
|
1313
|
-
except:
|
|
1314
|
-
writer.log.append('assert failed!')
|
|
1315
|
-
raise
|
|
1316
|
-
writer.log.append('asserted')
|
|
1317
|
-
|
|
1318
|
-
writer.finished_ok = True
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.')
|
|
1322
|
-
def test_check_tracer_with_exceptions(case_setup):
|
|
1323
|
-
|
|
1324
|
-
def get_environ(writer):
|
|
1325
|
-
env = os.environ.copy()
|
|
1326
|
-
# This test requires regular tracing (without cython).
|
|
1327
|
-
env['PYDEVD_USE_CYTHON'] = 'NO'
|
|
1328
|
-
env['PYDEVD_USE_FRAME_EVAL'] = 'NO'
|
|
1329
|
-
return env
|
|
1330
|
-
|
|
1331
|
-
with case_setup.test_file('_debugger_case_check_tracer.py', get_environ=get_environ) as writer:
|
|
1332
|
-
writer.write_add_exception_breakpoint_with_policy('IndexError', "1", "1", "1")
|
|
1333
|
-
writer.write_make_initial_run()
|
|
1334
|
-
writer.finished_ok = True
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
@pytest.mark.parametrize('target_file', [
|
|
1338
|
-
'_debugger_case_unhandled_exceptions_generator.py',
|
|
1339
|
-
'_debugger_case_unhandled_exceptions_listcomp.py',
|
|
1340
|
-
])
|
|
1341
|
-
@pytest.mark.parametrize('unhandled', [False, True])
|
|
1342
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Not ok for Jython.')
|
|
1343
|
-
def test_case_handled_and_unhandled_exception_generator(case_setup, target_file, unhandled):
|
|
1344
|
-
|
|
1345
|
-
def check_test_suceeded_msg(writer, stdout, stderr):
|
|
1346
|
-
# Don't call super (we have an unhandled exception in the stack trace).
|
|
1347
|
-
return 'TEST SUCEEDED' in ''.join(stdout) and 'TEST SUCEEDED' in ''.join(stderr)
|
|
1348
|
-
|
|
1349
|
-
def additional_output_checks(writer, stdout, stderr):
|
|
1350
|
-
if 'ZeroDivisionError' not in stderr:
|
|
1351
|
-
raise AssertionError('Expected test to have an unhandled exception.\nstdout:\n%s\n\nstderr:\n%s' % (
|
|
1352
|
-
stdout, stderr))
|
|
1353
|
-
|
|
1354
|
-
with case_setup.test_file(
|
|
1355
|
-
target_file,
|
|
1356
|
-
check_test_suceeded_msg=check_test_suceeded_msg,
|
|
1357
|
-
additional_output_checks=additional_output_checks,
|
|
1358
|
-
EXPECTED_RETURNCODE=1,
|
|
1359
|
-
) as writer:
|
|
1360
|
-
|
|
1361
|
-
if unhandled:
|
|
1362
|
-
writer.write_add_exception_breakpoint_with_policy('Exception', "0", "1", "0")
|
|
1363
|
-
else:
|
|
1364
|
-
writer.write_add_exception_breakpoint_with_policy('Exception', "1", "0", "0")
|
|
1365
|
-
|
|
1366
|
-
writer.write_make_initial_run()
|
|
1367
|
-
|
|
1368
|
-
hit = writer.wait_for_breakpoint_hit(REASON_UNCAUGHT_EXCEPTION if unhandled else REASON_CAUGHT_EXCEPTION)
|
|
1369
|
-
assert hit.line == writer.get_line_index_with_content('# exc line')
|
|
1370
|
-
|
|
1371
|
-
if 'generator' in target_file:
|
|
1372
|
-
expected_frame_names = ['<genexpr>', 'f', '<module>']
|
|
1373
|
-
else:
|
|
1374
|
-
expected_frame_names = ['<listcomp>', 'f', '<module>']
|
|
1375
|
-
|
|
1376
|
-
writer.write_get_current_exception(hit.thread_id)
|
|
1377
|
-
msg = writer.wait_for_message(accept_message=lambda msg:'exc_type="' in msg and 'exc_desc="' in msg, unquote_msg=False)
|
|
1378
|
-
|
|
1379
|
-
frame_names = [unquote(f['name']).replace('<', '<').replace('>', '>') for f in msg.thread.frame]
|
|
1380
|
-
assert frame_names == expected_frame_names
|
|
1381
|
-
|
|
1382
|
-
writer.write_run_thread(hit.thread_id)
|
|
1383
|
-
|
|
1384
|
-
if not unhandled:
|
|
1385
|
-
expected_lines = [
|
|
1386
|
-
writer.get_line_index_with_content('# exc line'),
|
|
1387
|
-
writer.get_line_index_with_content('# call exc'),
|
|
1388
|
-
]
|
|
1389
|
-
|
|
1390
|
-
for expected_line in expected_lines:
|
|
1391
|
-
hit = writer.wait_for_breakpoint_hit(REASON_CAUGHT_EXCEPTION)
|
|
1392
|
-
assert hit.line == expected_line
|
|
1393
|
-
|
|
1394
|
-
writer.write_get_current_exception(hit.thread_id)
|
|
1395
|
-
msg = writer.wait_for_message(accept_message=lambda msg:'exc_type="' in msg and 'exc_desc="' in msg, unquote_msg=False)
|
|
1396
|
-
|
|
1397
|
-
frame_names = [unquote(f['name']).replace('<', '<').replace('>', '>') for f in msg.thread.frame]
|
|
1398
|
-
assert frame_names == expected_frame_names
|
|
1399
|
-
|
|
1400
|
-
writer.write_run_thread(hit.thread_id)
|
|
1401
|
-
|
|
1402
|
-
writer.finished_ok = True
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Failing on Jython -- needs to be investigated).')
|
|
1406
|
-
def test_unhandled_exceptions_basic(case_setup):
|
|
1407
|
-
|
|
1408
|
-
def check_test_suceeded_msg(writer, stdout, stderr):
|
|
1409
|
-
# Don't call super (we have an unhandled exception in the stack trace).
|
|
1410
|
-
return 'TEST SUCEEDED' in ''.join(stdout) and 'TEST SUCEEDED' in ''.join(stderr)
|
|
1411
|
-
|
|
1412
|
-
def additional_output_checks(writer, stdout, stderr):
|
|
1413
|
-
if 'raise Exception' not in stderr:
|
|
1414
|
-
raise AssertionError('Expected test to have an unhandled exception.\nstdout:\n%s\n\nstderr:\n%s' % (
|
|
1415
|
-
stdout, stderr))
|
|
1416
|
-
|
|
1417
|
-
with case_setup.test_file(
|
|
1418
|
-
'_debugger_case_unhandled_exceptions.py',
|
|
1419
|
-
check_test_suceeded_msg=check_test_suceeded_msg,
|
|
1420
|
-
additional_output_checks=additional_output_checks,
|
|
1421
|
-
EXPECTED_RETURNCODE=1,
|
|
1422
|
-
) as writer:
|
|
1423
|
-
|
|
1424
|
-
writer.write_add_exception_breakpoint_with_policy('Exception', "0", "1", "0")
|
|
1425
|
-
writer.write_make_initial_run()
|
|
1426
|
-
|
|
1427
|
-
def check(hit, exc_type, exc_desc):
|
|
1428
|
-
writer.write_get_current_exception(hit.thread_id)
|
|
1429
|
-
msg = writer.wait_for_message(accept_message=lambda msg:exc_type in msg and 'exc_type="' in msg and 'exc_desc="' in msg, unquote_msg=False)
|
|
1430
|
-
assert unquote(msg.thread['exc_desc']) == exc_desc
|
|
1431
|
-
assert unquote(msg.thread['exc_type']) in (
|
|
1432
|
-
"<type 'exceptions.%s'>" % (exc_type,), # py2
|
|
1433
|
-
"<class '%s'>" % (exc_type,) # py3
|
|
1434
|
-
)
|
|
1435
|
-
if len(msg.thread.frame) == 0:
|
|
1436
|
-
assert unquote(unquote(msg.thread.frame['file'])).endswith('_debugger_case_unhandled_exceptions.py')
|
|
1437
|
-
else:
|
|
1438
|
-
assert unquote(unquote(msg.thread.frame[0]['file'])).endswith('_debugger_case_unhandled_exceptions.py')
|
|
1439
|
-
writer.write_run_thread(hit.thread_id)
|
|
1440
|
-
|
|
1441
|
-
# Will stop in 2 background threads
|
|
1442
|
-
hit0 = writer.wait_for_breakpoint_hit(REASON_UNCAUGHT_EXCEPTION)
|
|
1443
|
-
thread_id1 = hit0.thread_id
|
|
1444
|
-
|
|
1445
|
-
hit1 = writer.wait_for_breakpoint_hit(REASON_UNCAUGHT_EXCEPTION)
|
|
1446
|
-
thread_id2 = hit1.thread_id
|
|
1447
|
-
|
|
1448
|
-
if hit0.name == 'thread_func2':
|
|
1449
|
-
check(hit0, 'ValueError', 'in thread 2')
|
|
1450
|
-
check(hit1, 'Exception', 'in thread 1')
|
|
1451
|
-
else:
|
|
1452
|
-
check(hit0, 'Exception', 'in thread 1')
|
|
1453
|
-
check(hit1, 'ValueError', 'in thread 2')
|
|
1454
|
-
|
|
1455
|
-
writer.write_run_thread(thread_id1)
|
|
1456
|
-
writer.write_run_thread(thread_id2)
|
|
1457
|
-
|
|
1458
|
-
# Will stop in main thread
|
|
1459
|
-
hit = writer.wait_for_breakpoint_hit(REASON_UNCAUGHT_EXCEPTION)
|
|
1460
|
-
assert hit.name == '<module>'
|
|
1461
|
-
thread_id3 = hit.thread_id
|
|
1462
|
-
|
|
1463
|
-
# Requesting the stack in an unhandled exception should provide the stack of the exception,
|
|
1464
|
-
# not the current location of the program.
|
|
1465
|
-
writer.write_get_thread_stack(thread_id3)
|
|
1466
|
-
msg = writer.wait_for_message(CMD_GET_THREAD_STACK)
|
|
1467
|
-
assert len(msg.thread.frame) == 0 # In main thread (must have no back frames).
|
|
1468
|
-
assert msg.thread.frame['name'] == '<module>'
|
|
1469
|
-
check(hit, 'IndexError', 'in main')
|
|
1470
|
-
|
|
1471
|
-
writer.log.append('Marking finished ok.')
|
|
1472
|
-
writer.finished_ok = True
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Failing on Jython -- needs to be investigated).')
|
|
1476
|
-
def test_unhandled_exceptions_in_top_level1(case_setup_unhandled_exceptions):
|
|
1477
|
-
|
|
1478
|
-
with case_setup_unhandled_exceptions.test_file(
|
|
1479
|
-
'_debugger_case_unhandled_exceptions_on_top_level.py',
|
|
1480
|
-
EXPECTED_RETURNCODE=1,
|
|
1481
|
-
) as writer:
|
|
1482
|
-
|
|
1483
|
-
writer.write_add_exception_breakpoint_with_policy('Exception', "0", "1", "0")
|
|
1484
|
-
writer.write_make_initial_run()
|
|
1485
|
-
|
|
1486
|
-
# Will stop in main thread
|
|
1487
|
-
hit = writer.wait_for_breakpoint_hit(REASON_UNCAUGHT_EXCEPTION)
|
|
1488
|
-
writer.write_run_thread(hit.thread_id)
|
|
1489
|
-
|
|
1490
|
-
writer.log.append('Marking finished ok.')
|
|
1491
|
-
writer.finished_ok = True
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Failing on Jython -- needs to be investigated).')
|
|
1495
|
-
def test_unhandled_exceptions_in_top_level2(case_setup_unhandled_exceptions):
|
|
1496
|
-
# Note: expecting unhandled exception to be printed to stderr.
|
|
1497
|
-
|
|
1498
|
-
def get_environ(writer):
|
|
1499
|
-
env = os.environ.copy()
|
|
1500
|
-
curr_pythonpath = env.get('PYTHONPATH', '')
|
|
1501
|
-
|
|
1502
|
-
pydevd_dirname = os.path.dirname(writer.get_pydevd_file())
|
|
1503
|
-
|
|
1504
|
-
curr_pythonpath = pydevd_dirname + os.pathsep + curr_pythonpath
|
|
1505
|
-
env['PYTHONPATH'] = curr_pythonpath
|
|
1506
|
-
return env
|
|
1507
|
-
|
|
1508
|
-
def update_command_line_args(writer, args):
|
|
1509
|
-
# Start pydevd with '-m' to see how it deal with being called with
|
|
1510
|
-
# runpy at the start.
|
|
1511
|
-
assert args[0].endswith('pydevd.py')
|
|
1512
|
-
args = ['-m', 'pydevd'] + args[1:]
|
|
1513
|
-
return args
|
|
1514
|
-
|
|
1515
|
-
with case_setup_unhandled_exceptions.test_file(
|
|
1516
|
-
'_debugger_case_unhandled_exceptions_on_top_level.py',
|
|
1517
|
-
get_environ=get_environ,
|
|
1518
|
-
update_command_line_args=update_command_line_args,
|
|
1519
|
-
EXPECTED_RETURNCODE='any',
|
|
1520
|
-
) as writer:
|
|
1521
|
-
|
|
1522
|
-
writer.write_add_exception_breakpoint_with_policy('Exception', "0", "1", "0")
|
|
1523
|
-
writer.write_make_initial_run()
|
|
1524
|
-
|
|
1525
|
-
# Should stop (only once) in the main thread.
|
|
1526
|
-
hit = writer.wait_for_breakpoint_hit(REASON_UNCAUGHT_EXCEPTION)
|
|
1527
|
-
writer.write_run_thread(hit.thread_id)
|
|
1528
|
-
|
|
1529
|
-
writer.log.append('Marking finished ok.')
|
|
1530
|
-
writer.finished_ok = True
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Failing on Jython -- needs to be investigated).')
|
|
1534
|
-
def test_unhandled_exceptions_in_top_level3(case_setup_unhandled_exceptions):
|
|
1535
|
-
|
|
1536
|
-
with case_setup_unhandled_exceptions.test_file(
|
|
1537
|
-
'_debugger_case_unhandled_exceptions_on_top_level.py',
|
|
1538
|
-
EXPECTED_RETURNCODE=1
|
|
1539
|
-
) as writer:
|
|
1540
|
-
|
|
1541
|
-
# Handled and unhandled
|
|
1542
|
-
# PySide2 has a bug in shibokensupport which will try to do: sys._getframe(1).
|
|
1543
|
-
# during the teardown (which will fail as there's no back frame in this case).
|
|
1544
|
-
# So, mark ignore libraries in this case.
|
|
1545
|
-
writer.write_add_exception_breakpoint_with_policy('Exception', "1", "1", ignore_libraries="1")
|
|
1546
|
-
writer.write_make_initial_run()
|
|
1547
|
-
|
|
1548
|
-
# Will stop in main thread twice: once one we find that the exception is being
|
|
1549
|
-
# thrown and another in postmortem mode when we discover it's uncaught.
|
|
1550
|
-
hit = writer.wait_for_breakpoint_hit(REASON_CAUGHT_EXCEPTION)
|
|
1551
|
-
writer.write_run_thread(hit.thread_id)
|
|
1552
|
-
|
|
1553
|
-
hit = writer.wait_for_breakpoint_hit(REASON_UNCAUGHT_EXCEPTION)
|
|
1554
|
-
writer.write_run_thread(hit.thread_id)
|
|
1555
|
-
|
|
1556
|
-
writer.log.append('Marking finished ok.')
|
|
1557
|
-
writer.finished_ok = True
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Failing on Jython -- needs to be investigated).')
|
|
1561
|
-
def test_unhandled_exceptions_in_top_level4(case_setup_unhandled_exceptions):
|
|
1562
|
-
|
|
1563
|
-
# Note: expecting unhandled exception to be printed to stderr.
|
|
1564
|
-
with case_setup_unhandled_exceptions.test_file(
|
|
1565
|
-
'_debugger_case_unhandled_exceptions_on_top_level2.py',
|
|
1566
|
-
EXPECTED_RETURNCODE=1,
|
|
1567
|
-
) as writer:
|
|
1568
|
-
|
|
1569
|
-
# Handled and unhandled
|
|
1570
|
-
writer.write_add_exception_breakpoint_with_policy('Exception', "1", "1", "0")
|
|
1571
|
-
writer.write_make_initial_run()
|
|
1572
|
-
|
|
1573
|
-
# We have an exception thrown and handled and another which is thrown and is then unhandled.
|
|
1574
|
-
hit = writer.wait_for_breakpoint_hit(REASON_CAUGHT_EXCEPTION)
|
|
1575
|
-
writer.write_run_thread(hit.thread_id)
|
|
1576
|
-
|
|
1577
|
-
hit = writer.wait_for_breakpoint_hit(REASON_CAUGHT_EXCEPTION)
|
|
1578
|
-
writer.write_run_thread(hit.thread_id)
|
|
1579
|
-
|
|
1580
|
-
hit = writer.wait_for_breakpoint_hit(REASON_UNCAUGHT_EXCEPTION)
|
|
1581
|
-
writer.write_run_thread(hit.thread_id)
|
|
1582
|
-
|
|
1583
|
-
writer.log.append('Marking finished ok.')
|
|
1584
|
-
writer.finished_ok = True
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='Only for Python.')
|
|
1588
|
-
def test_case_set_next_statement(case_setup):
|
|
1589
|
-
|
|
1590
|
-
with case_setup.test_file('_debugger_case_set_next_statement.py') as writer:
|
|
1591
|
-
breakpoint_id = writer.write_add_breakpoint(6, None)
|
|
1592
|
-
writer.write_make_initial_run()
|
|
1593
|
-
|
|
1594
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT, line=6) # Stop in line a=3 (before setting it)
|
|
1595
|
-
|
|
1596
|
-
writer.write_evaluate_expression('%s\t%s\t%s' % (hit.thread_id, hit.frame_id, 'LOCAL'), 'a')
|
|
1597
|
-
writer.wait_for_evaluation('<var name="a" type="int" qualifier="{0}" value="int: 2"'.format(builtin_qualifier))
|
|
1598
|
-
writer.write_set_next_statement(hit.thread_id, 2, 'method')
|
|
1599
|
-
hit = writer.wait_for_breakpoint_hit('127', line=2)
|
|
1600
|
-
|
|
1601
|
-
# Check that it's still unchanged
|
|
1602
|
-
writer.write_evaluate_expression('%s\t%s\t%s' % (hit.thread_id, hit.frame_id, 'LOCAL'), 'a')
|
|
1603
|
-
writer.wait_for_evaluation('<var name="a" type="int" qualifier="{0}" value="int: 2"'.format(builtin_qualifier))
|
|
1604
|
-
|
|
1605
|
-
# After a step over it should become 1 as we executed line which sets a = 1
|
|
1606
|
-
writer.write_step_over(hit.thread_id)
|
|
1607
|
-
hit = writer.wait_for_breakpoint_hit('108')
|
|
1608
|
-
|
|
1609
|
-
writer.write_evaluate_expression('%s\t%s\t%s' % (hit.thread_id, hit.frame_id, 'LOCAL'), 'a')
|
|
1610
|
-
writer.wait_for_evaluation('<var name="a" type="int" qualifier="{0}" value="int: 1"'.format(builtin_qualifier))
|
|
1611
|
-
|
|
1612
|
-
writer.write_remove_breakpoint(breakpoint_id)
|
|
1613
|
-
writer.write_run_thread(hit.thread_id)
|
|
1614
|
-
|
|
1615
|
-
writer.finished_ok = True
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
def test_unhandled_exceptions_get_stack(case_setup_unhandled_exceptions):
|
|
1619
|
-
|
|
1620
|
-
with case_setup_unhandled_exceptions.test_file(
|
|
1621
|
-
'_debugger_case_unhandled_exception_get_stack.py',
|
|
1622
|
-
EXPECTED_RETURNCODE='any',
|
|
1623
|
-
) as writer:
|
|
1624
|
-
|
|
1625
|
-
writer.write_add_exception_breakpoint_with_policy('Exception', "0", "1", "0")
|
|
1626
|
-
writer.write_make_initial_run()
|
|
1627
|
-
|
|
1628
|
-
hit = writer.wait_for_breakpoint_hit(REASON_UNCAUGHT_EXCEPTION)
|
|
1629
|
-
writer.write_get_thread_stack(hit.thread_id)
|
|
1630
|
-
|
|
1631
|
-
msg = writer.wait_for_get_thread_stack_message()
|
|
1632
|
-
files = [frame['file'] for frame in msg.thread.frame]
|
|
1633
|
-
assert msg.thread['id'] == hit.thread_id
|
|
1634
|
-
if not files[0].endswith('_debugger_case_unhandled_exception_get_stack.py'):
|
|
1635
|
-
raise AssertionError('Expected to find _debugger_case_unhandled_exception_get_stack.py in files[0]. Found: %s' % ('\n'.join(files),))
|
|
1636
|
-
|
|
1637
|
-
assert len(msg.thread.frame) == 0 # No back frames (stopped in main).
|
|
1638
|
-
assert msg.thread.frame['name'] == '<module>'
|
|
1639
|
-
assert msg.thread.frame['line'] == str(writer.get_line_index_with_content('break line on unhandled exception'))
|
|
1640
|
-
|
|
1641
|
-
writer.write_run_thread(hit.thread_id)
|
|
1642
|
-
|
|
1643
|
-
writer.log.append('Marking finished ok.')
|
|
1644
|
-
writer.finished_ok = True
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
@pytest.mark.skipif(not IS_PY36_OR_GREATER, reason='Requires Python 3.')
|
|
1648
|
-
def test_case_throw_exc_reason_xml(case_setup):
|
|
1649
|
-
|
|
1650
|
-
def check_test_suceeded_msg(self, stdout, stderr):
|
|
1651
|
-
return 'TEST SUCEEDED' in ''.join(stderr)
|
|
1652
|
-
|
|
1653
|
-
def additional_output_checks(writer, stdout, stderr):
|
|
1654
|
-
assert "raise RuntimeError('TEST SUCEEDED')" in stderr
|
|
1655
|
-
assert "raise RuntimeError from e" in stderr
|
|
1656
|
-
assert "raise Exception('another while handling')" in stderr
|
|
1657
|
-
|
|
1658
|
-
with case_setup.test_file(
|
|
1659
|
-
'_debugger_case_raise_with_cause.py',
|
|
1660
|
-
EXPECTED_RETURNCODE=1,
|
|
1661
|
-
check_test_suceeded_msg=check_test_suceeded_msg,
|
|
1662
|
-
additional_output_checks=additional_output_checks
|
|
1663
|
-
) as writer:
|
|
1664
|
-
|
|
1665
|
-
writer.write_add_exception_breakpoint_with_policy('Exception', "0", "1", "0")
|
|
1666
|
-
writer.write_make_initial_run()
|
|
1667
|
-
|
|
1668
|
-
el = writer.wait_for_curr_exc_stack()
|
|
1669
|
-
name_and_lines = []
|
|
1670
|
-
for frame in el.thread.frame:
|
|
1671
|
-
name_and_lines.append((frame['name'], frame['line']))
|
|
1672
|
-
|
|
1673
|
-
assert name_and_lines == [
|
|
1674
|
-
('foobar', '20'),
|
|
1675
|
-
('<module>', '23'),
|
|
1676
|
-
('[Chained Exc: another while handling] foobar', '18'),
|
|
1677
|
-
('[Chained Exc: another while handling] handle', '10'),
|
|
1678
|
-
('[Chained Exc: TEST SUCEEDED] foobar', '16'),
|
|
1679
|
-
('[Chained Exc: TEST SUCEEDED] method', '6'),
|
|
1680
|
-
('[Chained Exc: TEST SUCEEDED] method2', '2'),
|
|
1681
|
-
]
|
|
1682
|
-
|
|
1683
|
-
hit = writer.wait_for_breakpoint_hit(REASON_UNCAUGHT_EXCEPTION)
|
|
1684
|
-
writer.write_get_thread_stack(hit.thread_id)
|
|
1685
|
-
|
|
1686
|
-
writer.write_run_thread(hit.thread_id)
|
|
1687
|
-
|
|
1688
|
-
writer.finished_ok = True
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='Only for Python.')
|
|
1692
|
-
def test_case_get_next_statement_targets(case_setup):
|
|
1693
|
-
with case_setup.test_file('_debugger_case_get_next_statement_targets.py') as writer:
|
|
1694
|
-
breakpoint_id = writer.write_add_breakpoint(21, None)
|
|
1695
|
-
writer.write_make_initial_run()
|
|
1696
|
-
|
|
1697
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT, line=21)
|
|
1698
|
-
|
|
1699
|
-
writer.write_get_next_statement_targets(hit.thread_id, hit.frame_id)
|
|
1700
|
-
targets = writer.wait_for_get_next_statement_targets()
|
|
1701
|
-
# Note: 20 may appear as a side-effect of the frame eval
|
|
1702
|
-
# mode (so, we have to ignore it here) -- this isn't ideal, but
|
|
1703
|
-
# it's also not that bad (that line has no code in the source and
|
|
1704
|
-
# executing it will just set the tracing for the method).
|
|
1705
|
-
targets.discard(20)
|
|
1706
|
-
# On Python 3.11 there's now a line 1 (which should be harmless).
|
|
1707
|
-
targets.discard(1)
|
|
1708
|
-
expected = set((2, 3, 5, 8, 9, 10, 12, 13, 14, 15, 17, 18, 19, 21))
|
|
1709
|
-
assert targets == expected, 'Expected targets to be %s, was: %s' % (expected, targets)
|
|
1710
|
-
|
|
1711
|
-
writer.write_remove_breakpoint(breakpoint_id)
|
|
1712
|
-
writer.write_run_thread(hit.thread_id)
|
|
1713
|
-
|
|
1714
|
-
writer.finished_ok = True
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
@pytest.mark.skipif(IS_IRONPYTHON or IS_JYTHON, reason='Failing on IronPython and Jython (needs to be investigated).')
|
|
1718
|
-
def test_case_type_ext(case_setup):
|
|
1719
|
-
# Custom type presentation extensions
|
|
1720
|
-
|
|
1721
|
-
def get_environ(self):
|
|
1722
|
-
env = os.environ.copy()
|
|
1723
|
-
|
|
1724
|
-
python_path = env.get("PYTHONPATH", "")
|
|
1725
|
-
ext_base = debugger_unittest._get_debugger_test_file('my_extensions')
|
|
1726
|
-
env['PYTHONPATH'] = ext_base + os.pathsep + python_path if python_path else ext_base
|
|
1727
|
-
return env
|
|
1728
|
-
|
|
1729
|
-
with case_setup.test_file('_debugger_case_type_ext.py', get_environ=get_environ) as writer:
|
|
1730
|
-
writer.get_environ = get_environ
|
|
1731
|
-
|
|
1732
|
-
writer.write_add_breakpoint(7, None)
|
|
1733
|
-
writer.write_make_initial_run()
|
|
1734
|
-
|
|
1735
|
-
hit = writer.wait_for_breakpoint_hit('111')
|
|
1736
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
1737
|
-
assert writer.wait_for_var([
|
|
1738
|
-
[
|
|
1739
|
-
r'<var name="my_rect" type="Rect" qualifier="__main__" value="Rectangle%255BLength%253A 5%252C Width%253A 10 %252C Area%253A 50%255D" isContainer="True" />',
|
|
1740
|
-
r'<var name="my_rect" type="Rect" value="Rect: <__main__.Rect object at', # Jython
|
|
1741
|
-
]
|
|
1742
|
-
])
|
|
1743
|
-
writer.write_get_variable(hit.thread_id, hit.frame_id, 'my_rect')
|
|
1744
|
-
assert writer.wait_for_var(r'<var name="area" type="int" qualifier="{0}" value="int%253A 50" />'.format(builtin_qualifier))
|
|
1745
|
-
writer.write_run_thread(hit.thread_id)
|
|
1746
|
-
writer.finished_ok = True
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
def test_case_variable_access(case_setup, pyfile, data_regression):
|
|
1750
|
-
|
|
1751
|
-
@pyfile
|
|
1752
|
-
def case_custom():
|
|
1753
|
-
obj = [
|
|
1754
|
-
tuple(range(9)),
|
|
1755
|
-
[
|
|
1756
|
-
tuple(range(5)),
|
|
1757
|
-
]
|
|
1758
|
-
]
|
|
1759
|
-
|
|
1760
|
-
print('TEST SUCEEDED')
|
|
1761
|
-
|
|
1762
|
-
with case_setup.test_file(case_custom) as writer:
|
|
1763
|
-
line = writer.get_line_index_with_content('TEST SUCEEDED')
|
|
1764
|
-
writer.write_add_breakpoint(line)
|
|
1765
|
-
writer.write_make_initial_run()
|
|
1766
|
-
|
|
1767
|
-
hit = writer.wait_for_breakpoint_hit('111')
|
|
1768
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
1769
|
-
|
|
1770
|
-
frame_vars = writer.wait_for_untangled_message(
|
|
1771
|
-
accept_message=lambda cmd_id, untangled: cmd_id == CMD_GET_FRAME)
|
|
1772
|
-
|
|
1773
|
-
obj_var = [v for v in frame_vars.var if v['name'] == 'obj'][0]
|
|
1774
|
-
assert obj_var['type'] == 'list'
|
|
1775
|
-
assert unquote_plus(obj_var['value']) == "<class 'list'>: [(0, 1, 2, 3, 4, 5, 6, 7, 8), [(0, 1, 2, 3, 4)]]"
|
|
1776
|
-
assert obj_var['isContainer'] == "True"
|
|
1777
|
-
|
|
1778
|
-
def _skip_key_in_dict(key):
|
|
1779
|
-
try:
|
|
1780
|
-
int(key)
|
|
1781
|
-
except ValueError:
|
|
1782
|
-
if 'more' in key or '[' in key:
|
|
1783
|
-
return False
|
|
1784
|
-
return True
|
|
1785
|
-
return False
|
|
1786
|
-
|
|
1787
|
-
def collect_vars(locator, level=0):
|
|
1788
|
-
writer.write("%s\t%s\t%s\t%s" % (CMD_GET_VARIABLE, writer.next_seq(), hit.thread_id, locator))
|
|
1789
|
-
obj_vars = writer.wait_for_untangled_message(
|
|
1790
|
-
accept_message=lambda cmd_id, _untangled: cmd_id == CMD_GET_VARIABLE)
|
|
1791
|
-
|
|
1792
|
-
for v in obj_vars.var:
|
|
1793
|
-
if _skip_key_in_dict(v['name']):
|
|
1794
|
-
continue
|
|
1795
|
-
new_locator = locator + '\t' + v['name']
|
|
1796
|
-
yield level, v, new_locator
|
|
1797
|
-
if v['isContainer'] == 'True':
|
|
1798
|
-
yield from collect_vars(new_locator, level + 1)
|
|
1799
|
-
|
|
1800
|
-
found = []
|
|
1801
|
-
for level, val, _locator in collect_vars('%s\tFRAME\tobj' % hit.frame_id):
|
|
1802
|
-
found.append(((' ' * level) + val['name'] + ': ' + unquote_plus(val['value'])))
|
|
1803
|
-
|
|
1804
|
-
data_regression.check(found)
|
|
1805
|
-
|
|
1806
|
-
# Check referrers
|
|
1807
|
-
full_loc = '%s\t%s\t%s' % (hit.thread_id, hit.frame_id, 'FRAME\tobj\t1\t0')
|
|
1808
|
-
writer.write_custom_operation(full_loc, 'EXEC', "from _pydevd_bundle.pydevd_referrers import get_referrer_info", "get_referrer_info")
|
|
1809
|
-
msg = writer.wait_for_untangled_message(
|
|
1810
|
-
double_unquote=True,
|
|
1811
|
-
accept_message=lambda cmd_id, _untangled: cmd_id == CMD_RUN_CUSTOM_OPERATION)
|
|
1812
|
-
|
|
1813
|
-
msg_vars = msg.var
|
|
1814
|
-
try:
|
|
1815
|
-
msg_vars['found_as']
|
|
1816
|
-
msg_vars = [msg_vars]
|
|
1817
|
-
except:
|
|
1818
|
-
pass # it's a container.
|
|
1819
|
-
|
|
1820
|
-
for v in msg_vars:
|
|
1821
|
-
if v['found_as'] == 'list[0]':
|
|
1822
|
-
# In pypy we may have more than one reference, find out the one
|
|
1823
|
-
referrer_id = v['id']
|
|
1824
|
-
assert int(referrer_id)
|
|
1825
|
-
assert unquote_plus(v['value']) == "<class 'list'>: [(0, 1, 2, 3, 4)]"
|
|
1826
|
-
break
|
|
1827
|
-
else:
|
|
1828
|
-
raise AssertionError("Unable to find ref with list[0]. Found: %s" % (msg_vars,))
|
|
1829
|
-
|
|
1830
|
-
found = []
|
|
1831
|
-
by_id_locator = '%s\t%s' % (referrer_id, 'BY_ID')
|
|
1832
|
-
for level, val, _locator in collect_vars(by_id_locator):
|
|
1833
|
-
found.append(((' ' * level) + val['name'] + ': ' + unquote_plus(val['value'])))
|
|
1834
|
-
|
|
1835
|
-
data_regression.check(found, basename='test_case_variable_access_by_id')
|
|
1836
|
-
|
|
1837
|
-
writer.write_run_thread(hit.thread_id)
|
|
1838
|
-
writer.finished_ok = True
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
@pytest.mark.skipif(IS_IRONPYTHON or IS_JYTHON, reason='Failing on IronPython and Jython (needs to be investigated).')
|
|
1842
|
-
def test_case_event_ext(case_setup):
|
|
1843
|
-
|
|
1844
|
-
def get_environ(self):
|
|
1845
|
-
env = os.environ.copy()
|
|
1846
|
-
|
|
1847
|
-
python_path = env.get("PYTHONPATH", "")
|
|
1848
|
-
ext_base = debugger_unittest._get_debugger_test_file('my_extensions')
|
|
1849
|
-
env['PYTHONPATH'] = ext_base + os.pathsep + python_path if python_path else ext_base
|
|
1850
|
-
env["VERIFY_EVENT_TEST"] = "1"
|
|
1851
|
-
return env
|
|
1852
|
-
|
|
1853
|
-
# Test initialize event for extensions
|
|
1854
|
-
with case_setup.test_file('_debugger_case_event_ext.py', get_environ=get_environ) as writer:
|
|
1855
|
-
|
|
1856
|
-
original_additional_output_checks = writer.additional_output_checks
|
|
1857
|
-
|
|
1858
|
-
@overrides(writer.additional_output_checks)
|
|
1859
|
-
def additional_output_checks(stdout, stderr):
|
|
1860
|
-
original_additional_output_checks(stdout, stderr)
|
|
1861
|
-
if 'INITIALIZE EVENT RECEIVED' not in stdout:
|
|
1862
|
-
raise AssertionError('No initialize event received')
|
|
1863
|
-
|
|
1864
|
-
writer.additional_output_checks = additional_output_checks
|
|
1865
|
-
|
|
1866
|
-
writer.write_make_initial_run()
|
|
1867
|
-
writer.finished_ok = True
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Jython does not seem to be creating thread started inside tracing (investigate).')
|
|
1871
|
-
def test_case_writer_creation_deadlock(case_setup):
|
|
1872
|
-
# check case where there was a deadlock evaluating expressions
|
|
1873
|
-
with case_setup.test_file('_debugger_case_thread_creation_deadlock.py') as writer:
|
|
1874
|
-
writer.write_add_breakpoint(26, None)
|
|
1875
|
-
writer.write_make_initial_run()
|
|
1876
|
-
|
|
1877
|
-
hit = writer.wait_for_breakpoint_hit('111')
|
|
1878
|
-
|
|
1879
|
-
assert hit.line == 26, 'Expected return to be in line 26, was: %s' % (hit.line,)
|
|
1880
|
-
|
|
1881
|
-
writer.write_evaluate_expression('%s\t%s\t%s' % (hit.thread_id, hit.frame_id, 'LOCAL'), 'create_thread()')
|
|
1882
|
-
writer.wait_for_evaluation('<var name="create_thread()" type="str" qualifier="{0}" value="str: create_thread:ok'.format(builtin_qualifier))
|
|
1883
|
-
writer.write_run_thread(hit.thread_id)
|
|
1884
|
-
|
|
1885
|
-
writer.finished_ok = True
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
def test_case_skip_breakpoints_in_exceptions(case_setup):
|
|
1889
|
-
# Case where breakpoint is skipped after an exception is raised over it
|
|
1890
|
-
with case_setup.test_file('_debugger_case_skip_breakpoint_in_exceptions.py') as writer:
|
|
1891
|
-
writer.write_add_breakpoint(5, None)
|
|
1892
|
-
writer.write_make_initial_run()
|
|
1893
|
-
|
|
1894
|
-
hit = writer.wait_for_breakpoint_hit('111', line=5)
|
|
1895
|
-
writer.write_run_thread(hit.thread_id)
|
|
1896
|
-
|
|
1897
|
-
hit = writer.wait_for_breakpoint_hit('111', line=5)
|
|
1898
|
-
writer.write_run_thread(hit.thread_id)
|
|
1899
|
-
|
|
1900
|
-
writer.finished_ok = True
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
def test_case_handled_exceptions0(case_setup):
|
|
1904
|
-
# Stop only once per handled exception.
|
|
1905
|
-
with case_setup.test_file('_debugger_case_exceptions.py') as writer:
|
|
1906
|
-
writer.write_set_project_roots([os.path.dirname(writer.TEST_FILE)])
|
|
1907
|
-
writer.write_add_exception_breakpoint_with_policy(
|
|
1908
|
-
'IndexError',
|
|
1909
|
-
notify_on_handled_exceptions=2, # Notify only once
|
|
1910
|
-
notify_on_unhandled_exceptions=0,
|
|
1911
|
-
ignore_libraries=1
|
|
1912
|
-
)
|
|
1913
|
-
writer.write_make_initial_run()
|
|
1914
|
-
|
|
1915
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
1916
|
-
REASON_CAUGHT_EXCEPTION,
|
|
1917
|
-
line=writer.get_line_index_with_content('raise indexerror line')
|
|
1918
|
-
)
|
|
1919
|
-
|
|
1920
|
-
writer.write_run_thread(hit.thread_id)
|
|
1921
|
-
|
|
1922
|
-
writer.finished_ok = True
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Not working on Jython (needs to be investigated).')
|
|
1926
|
-
def test_case_handled_exceptions1(case_setup):
|
|
1927
|
-
|
|
1928
|
-
# Stop multiple times for the same handled exception.
|
|
1929
|
-
def get_environ(self):
|
|
1930
|
-
env = os.environ.copy()
|
|
1931
|
-
|
|
1932
|
-
env["IDE_PROJECT_ROOTS"] = os.path.dirname(self.TEST_FILE)
|
|
1933
|
-
return env
|
|
1934
|
-
|
|
1935
|
-
with case_setup.test_file('_debugger_case_exceptions.py', get_environ=get_environ) as writer:
|
|
1936
|
-
writer.write_add_exception_breakpoint_with_policy(
|
|
1937
|
-
'IndexError',
|
|
1938
|
-
notify_on_handled_exceptions=1, # Notify multiple times
|
|
1939
|
-
notify_on_unhandled_exceptions=0,
|
|
1940
|
-
ignore_libraries=1
|
|
1941
|
-
)
|
|
1942
|
-
writer.write_make_initial_run()
|
|
1943
|
-
|
|
1944
|
-
def check(hit):
|
|
1945
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
1946
|
-
writer.wait_for_message(accept_message=lambda msg:'__exception__' in msg and 'IndexError' in msg, unquote_msg=False)
|
|
1947
|
-
writer.write_get_current_exception(hit.thread_id)
|
|
1948
|
-
msg = writer.wait_for_message(accept_message=lambda msg:'IndexError' in msg and 'exc_type="' in msg and 'exc_desc="' in msg, unquote_msg=False)
|
|
1949
|
-
assert msg.thread['exc_desc'] == 'foo'
|
|
1950
|
-
assert unquote(msg.thread['exc_type']) in (
|
|
1951
|
-
"<type 'exceptions.IndexError'>", # py2
|
|
1952
|
-
"<class 'IndexError'>" # py3
|
|
1953
|
-
)
|
|
1954
|
-
|
|
1955
|
-
assert unquote(unquote(msg.thread.frame[0]['file'])).endswith('_debugger_case_exceptions.py')
|
|
1956
|
-
writer.write_run_thread(hit.thread_id)
|
|
1957
|
-
|
|
1958
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
1959
|
-
REASON_CAUGHT_EXCEPTION, line=writer.get_line_index_with_content('raise indexerror line'))
|
|
1960
|
-
check(hit)
|
|
1961
|
-
|
|
1962
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
1963
|
-
REASON_CAUGHT_EXCEPTION, line=writer.get_line_index_with_content('reraise on method2'))
|
|
1964
|
-
check(hit)
|
|
1965
|
-
|
|
1966
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
1967
|
-
REASON_CAUGHT_EXCEPTION, line=writer.get_line_index_with_content('handle on method1'))
|
|
1968
|
-
check(hit)
|
|
1969
|
-
|
|
1970
|
-
writer.finished_ok = True
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
def test_case_handled_exceptions2(case_setup):
|
|
1974
|
-
|
|
1975
|
-
# No IDE_PROJECT_ROOTS set.
|
|
1976
|
-
def get_environ(self):
|
|
1977
|
-
env = os.environ.copy()
|
|
1978
|
-
|
|
1979
|
-
# Don't stop anywhere (note: having IDE_PROJECT_ROOTS = '' will consider
|
|
1980
|
-
# having anything not under site-packages as being in the project).
|
|
1981
|
-
env["IDE_PROJECT_ROOTS"] = '["empty"]'
|
|
1982
|
-
return env
|
|
1983
|
-
|
|
1984
|
-
with case_setup.test_file('_debugger_case_exceptions.py', get_environ=get_environ) as writer:
|
|
1985
|
-
writer.write_add_exception_breakpoint_with_policy(
|
|
1986
|
-
'IndexError',
|
|
1987
|
-
notify_on_handled_exceptions=1, # Notify multiple times
|
|
1988
|
-
notify_on_unhandled_exceptions=0,
|
|
1989
|
-
ignore_libraries=1
|
|
1990
|
-
)
|
|
1991
|
-
writer.write_make_initial_run()
|
|
1992
|
-
|
|
1993
|
-
writer.finished_ok = True
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
def test_case_handled_exceptions3(case_setup):
|
|
1997
|
-
|
|
1998
|
-
# Don't stop on exception thrown in the same context (only at caller).
|
|
1999
|
-
def get_environ(self):
|
|
2000
|
-
env = os.environ.copy()
|
|
2001
|
-
|
|
2002
|
-
env["IDE_PROJECT_ROOTS"] = os.path.dirname(self.TEST_FILE)
|
|
2003
|
-
return env
|
|
2004
|
-
|
|
2005
|
-
with case_setup.test_file('_debugger_case_exceptions.py', get_environ=get_environ) as writer:
|
|
2006
|
-
# Note: in this mode we'll only stop once.
|
|
2007
|
-
writer.write_set_py_exception_globals(
|
|
2008
|
-
break_on_uncaught=False,
|
|
2009
|
-
break_on_caught=True,
|
|
2010
|
-
skip_on_exceptions_thrown_in_same_context=False,
|
|
2011
|
-
ignore_exceptions_thrown_in_lines_with_ignore_exception=True,
|
|
2012
|
-
ignore_libraries=True,
|
|
2013
|
-
exceptions=('IndexError',)
|
|
2014
|
-
)
|
|
2015
|
-
|
|
2016
|
-
writer.write_make_initial_run()
|
|
2017
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
2018
|
-
REASON_CAUGHT_EXCEPTION, line=writer.get_line_index_with_content('raise indexerror line'))
|
|
2019
|
-
writer.write_run_thread(hit.thread_id)
|
|
2020
|
-
|
|
2021
|
-
writer.finished_ok = True
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
def test_case_handled_exceptions4(case_setup):
|
|
2025
|
-
|
|
2026
|
-
# Don't stop on exception thrown in the same context (only at caller).
|
|
2027
|
-
def get_environ(self):
|
|
2028
|
-
env = os.environ.copy()
|
|
2029
|
-
|
|
2030
|
-
env["IDE_PROJECT_ROOTS"] = os.path.dirname(self.TEST_FILE)
|
|
2031
|
-
return env
|
|
2032
|
-
|
|
2033
|
-
with case_setup.test_file('_debugger_case_exceptions.py', get_environ=get_environ) as writer:
|
|
2034
|
-
# Note: in this mode we'll only stop once.
|
|
2035
|
-
writer.write_set_py_exception_globals(
|
|
2036
|
-
break_on_uncaught=False,
|
|
2037
|
-
break_on_caught=True,
|
|
2038
|
-
skip_on_exceptions_thrown_in_same_context=True,
|
|
2039
|
-
ignore_exceptions_thrown_in_lines_with_ignore_exception=True,
|
|
2040
|
-
ignore_libraries=True,
|
|
2041
|
-
exceptions=('IndexError',)
|
|
2042
|
-
)
|
|
2043
|
-
|
|
2044
|
-
writer.write_make_initial_run()
|
|
2045
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
2046
|
-
REASON_CAUGHT_EXCEPTION, line=writer.get_line_index_with_content('reraise on method2'))
|
|
2047
|
-
writer.write_run_thread(hit.thread_id)
|
|
2048
|
-
|
|
2049
|
-
writer.finished_ok = True
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
def test_case_settrace(case_setup):
|
|
2053
|
-
with case_setup.test_file('_debugger_case_settrace.py') as writer:
|
|
2054
|
-
writer.write_make_initial_run()
|
|
2055
|
-
|
|
2056
|
-
hit = writer.wait_for_breakpoint_hit('108', line=12)
|
|
2057
|
-
writer.write_run_thread(hit.thread_id)
|
|
2058
|
-
|
|
2059
|
-
hit = writer.wait_for_breakpoint_hit(line=7)
|
|
2060
|
-
writer.write_run_thread(hit.thread_id)
|
|
2061
|
-
|
|
2062
|
-
writer.finished_ok = True
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
@pytest.mark.skipif(True, reason='This is *very* flaky.')
|
|
2066
|
-
def test_case_scapy(case_setup):
|
|
2067
|
-
with case_setup.test_file('_debugger_case_scapy.py') as writer:
|
|
2068
|
-
writer.FORCE_KILL_PROCESS_WHEN_FINISHED_OK = True
|
|
2069
|
-
writer.reader_thread.set_messages_timeout(30) # Starting scapy may be slow (timed out with 15 seconds on appveyor).
|
|
2070
|
-
writer.write_add_breakpoint(2, None)
|
|
2071
|
-
writer.write_make_initial_run()
|
|
2072
|
-
|
|
2073
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
2074
|
-
thread_id = hit.thread_id
|
|
2075
|
-
frame_id = hit.frame_id
|
|
2076
|
-
|
|
2077
|
-
writer.write_run_thread(thread_id)
|
|
2078
|
-
writer.finished_ok = True
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
@pytest.mark.skipif(IS_APPVEYOR or IS_JYTHON, reason='Flaky on appveyor / Jython encoding issues (needs investigation).')
|
|
2082
|
-
def test_redirect_output(case_setup):
|
|
2083
|
-
|
|
2084
|
-
def get_environ(writer):
|
|
2085
|
-
env = os.environ.copy()
|
|
2086
|
-
|
|
2087
|
-
env["PYTHONIOENCODING"] = 'utf-8'
|
|
2088
|
-
return env
|
|
2089
|
-
|
|
2090
|
-
with case_setup.test_file('_debugger_case_redirect.py', get_environ=get_environ) as writer:
|
|
2091
|
-
original_ignore_stderr_line = writer._ignore_stderr_line
|
|
2092
|
-
|
|
2093
|
-
@overrides(writer._ignore_stderr_line)
|
|
2094
|
-
def _ignore_stderr_line(line):
|
|
2095
|
-
if original_ignore_stderr_line(line):
|
|
2096
|
-
return True
|
|
2097
|
-
|
|
2098
|
-
binary_junk = b'\xe8\xF0\x80\x80\x80'
|
|
2099
|
-
if sys.version_info[0] >= 3:
|
|
2100
|
-
binary_junk = binary_junk.decode('utf-8', 'replace')
|
|
2101
|
-
|
|
2102
|
-
return line.startswith((
|
|
2103
|
-
'text',
|
|
2104
|
-
'binary',
|
|
2105
|
-
'a',
|
|
2106
|
-
binary_junk,
|
|
2107
|
-
))
|
|
2108
|
-
|
|
2109
|
-
writer._ignore_stderr_line = _ignore_stderr_line
|
|
2110
|
-
|
|
2111
|
-
# Note: writes to stdout and stderr are now synchronous (so, the order
|
|
2112
|
-
# must always be consistent and there's a message for each write).
|
|
2113
|
-
expected = [
|
|
2114
|
-
'text\n',
|
|
2115
|
-
'binary or text\n',
|
|
2116
|
-
'ação1\n',
|
|
2117
|
-
]
|
|
2118
|
-
|
|
2119
|
-
if sys.version_info[0] >= 3:
|
|
2120
|
-
expected.extend((
|
|
2121
|
-
'binary\n',
|
|
2122
|
-
'ação2\n'.encode(encoding='latin1').decode('utf-8', 'replace'),
|
|
2123
|
-
'ação3\n',
|
|
2124
|
-
))
|
|
2125
|
-
|
|
2126
|
-
binary_junk = '\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\n\n'
|
|
2127
|
-
if sys.version_info[0] >= 3:
|
|
2128
|
-
binary_junk = "\ufffd\ufffd\ufffd\ufffd\ufffd\n\n"
|
|
2129
|
-
expected.append(binary_junk)
|
|
2130
|
-
|
|
2131
|
-
new_expected = [(x, 'stdout') for x in expected]
|
|
2132
|
-
new_expected.extend([(x, 'stderr') for x in expected])
|
|
2133
|
-
|
|
2134
|
-
writer.write_start_redirect()
|
|
2135
|
-
|
|
2136
|
-
writer.write_make_initial_run()
|
|
2137
|
-
msgs = []
|
|
2138
|
-
ignored = []
|
|
2139
|
-
while len(msgs) < len(new_expected):
|
|
2140
|
-
try:
|
|
2141
|
-
msg = writer.wait_for_output()
|
|
2142
|
-
except AssertionError:
|
|
2143
|
-
for msg in msgs:
|
|
2144
|
-
sys.stderr.write('Found: %s\n' % (msg,))
|
|
2145
|
-
for msg in new_expected:
|
|
2146
|
-
sys.stderr.write('Expected: %s\n' % (msg,))
|
|
2147
|
-
for msg in ignored:
|
|
2148
|
-
sys.stderr.write('Ignored: %s\n' % (msg,))
|
|
2149
|
-
raise
|
|
2150
|
-
if msg not in new_expected:
|
|
2151
|
-
ignored.append(msg)
|
|
2152
|
-
continue
|
|
2153
|
-
msgs.append(msg)
|
|
2154
|
-
|
|
2155
|
-
if msgs != new_expected:
|
|
2156
|
-
print(msgs)
|
|
2157
|
-
print(new_expected)
|
|
2158
|
-
assert msgs == new_expected
|
|
2159
|
-
writer.finished_ok = True
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
def _path_equals(path1, path2):
|
|
2163
|
-
path1 = pydevd_file_utils.normcase(path1)
|
|
2164
|
-
path2 = pydevd_file_utils.normcase(path2)
|
|
2165
|
-
return path1 == path2
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
@pytest.mark.parametrize('mixed_case', [True, False] if sys.platform == 'win32' else [False])
|
|
2169
|
-
def test_path_translation(case_setup, mixed_case):
|
|
2170
|
-
|
|
2171
|
-
def get_file_in_client(writer):
|
|
2172
|
-
# Instead of using: test_python/_debugger_case_path_translation.py
|
|
2173
|
-
# we'll set the breakpoints at foo/_debugger_case_path_translation.py
|
|
2174
|
-
file_in_client = os.path.dirname(os.path.dirname(writer.TEST_FILE))
|
|
2175
|
-
return os.path.join(os.path.dirname(file_in_client), 'foo', '_debugger_case_path_translation.py')
|
|
2176
|
-
|
|
2177
|
-
def get_environ(writer):
|
|
2178
|
-
import json
|
|
2179
|
-
env = os.environ.copy()
|
|
2180
|
-
|
|
2181
|
-
env["PYTHONIOENCODING"] = 'utf-8'
|
|
2182
|
-
|
|
2183
|
-
assert writer.TEST_FILE.endswith('_debugger_case_path_translation.py')
|
|
2184
|
-
file_in_client = get_file_in_client(writer)
|
|
2185
|
-
if mixed_case:
|
|
2186
|
-
new_file_in_client = ''.join([file_in_client[i].upper() if i % 2 == 0 else file_in_client[i].lower() for i in range(len(file_in_client))])
|
|
2187
|
-
assert _path_equals(file_in_client, new_file_in_client)
|
|
2188
|
-
env["PATHS_FROM_ECLIPSE_TO_PYTHON"] = json.dumps([
|
|
2189
|
-
(
|
|
2190
|
-
os.path.dirname(file_in_client),
|
|
2191
|
-
os.path.dirname(writer.TEST_FILE)
|
|
2192
|
-
)
|
|
2193
|
-
])
|
|
2194
|
-
return env
|
|
2195
|
-
|
|
2196
|
-
with case_setup.test_file('_debugger_case_path_translation.py', get_environ=get_environ) as writer:
|
|
2197
|
-
from tests_python.debugger_unittest import CMD_LOAD_SOURCE
|
|
2198
|
-
writer.write_start_redirect()
|
|
2199
|
-
|
|
2200
|
-
file_in_client = get_file_in_client(writer)
|
|
2201
|
-
assert 'tests_python' not in file_in_client
|
|
2202
|
-
writer.write_add_breakpoint(
|
|
2203
|
-
writer.get_line_index_with_content('break here'), 'call_this', filename=file_in_client)
|
|
2204
|
-
writer.write_make_initial_run()
|
|
2205
|
-
|
|
2206
|
-
xml = writer.wait_for_message(lambda msg:'stop_reason="111"' in msg)
|
|
2207
|
-
assert xml.thread.frame[0]['file'] == file_in_client
|
|
2208
|
-
thread_id = xml.thread['id']
|
|
2209
|
-
|
|
2210
|
-
# Request a file that exists
|
|
2211
|
-
files_to_match = [file_in_client]
|
|
2212
|
-
if IS_WINDOWS:
|
|
2213
|
-
files_to_match.append(file_in_client.upper())
|
|
2214
|
-
for f in files_to_match:
|
|
2215
|
-
writer.write_load_source(f)
|
|
2216
|
-
writer.wait_for_message(
|
|
2217
|
-
lambda msg:
|
|
2218
|
-
'%s\t' % CMD_LOAD_SOURCE in msg and \
|
|
2219
|
-
"def main():" in msg and \
|
|
2220
|
-
"print('break here')" in msg and \
|
|
2221
|
-
"print('TEST SUCEEDED!')" in msg
|
|
2222
|
-
, expect_xml=False)
|
|
2223
|
-
|
|
2224
|
-
# Request a file that does not exist
|
|
2225
|
-
writer.write_load_source(file_in_client + 'not_existent.py')
|
|
2226
|
-
writer.wait_for_message(
|
|
2227
|
-
lambda msg:'901\t' in msg and ('FileNotFoundError' in msg or 'IOError' in msg),
|
|
2228
|
-
expect_xml=False)
|
|
2229
|
-
|
|
2230
|
-
writer.write_run_thread(thread_id)
|
|
2231
|
-
|
|
2232
|
-
writer.finished_ok = True
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.')
|
|
2236
|
-
def test_linecache_xml(case_setup, tmpdir):
|
|
2237
|
-
from _pydevd_bundle.pydevd_comm_constants import CMD_LOAD_SOURCE_FROM_FRAME_ID
|
|
2238
|
-
|
|
2239
|
-
with case_setup.test_file('_debugger_case_linecache.py') as writer:
|
|
2240
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('breakpoint'))
|
|
2241
|
-
writer.write_make_initial_run()
|
|
2242
|
-
|
|
2243
|
-
# First hit is for breakpoint reached via a stack frame that doesn't have source.
|
|
2244
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
2245
|
-
|
|
2246
|
-
writer.write_get_thread_stack(hit.thread_id)
|
|
2247
|
-
msg = writer.wait_for_get_thread_stack_message()
|
|
2248
|
-
frame_ids = set()
|
|
2249
|
-
for frame in msg.thread.frame:
|
|
2250
|
-
if frame['file'] == '<foo bar>':
|
|
2251
|
-
frame_ids.add(frame['id'])
|
|
2252
|
-
|
|
2253
|
-
assert len(frame_ids) == 2
|
|
2254
|
-
|
|
2255
|
-
for frame_id in frame_ids:
|
|
2256
|
-
writer.write_load_source_from_frame_id(frame_id)
|
|
2257
|
-
writer.wait_for_message(
|
|
2258
|
-
lambda msg:
|
|
2259
|
-
'%s\t' % CMD_LOAD_SOURCE_FROM_FRAME_ID in msg and (
|
|
2260
|
-
"[x for x in range(10)]" in msg and "def somemethod():" in msg
|
|
2261
|
-
)
|
|
2262
|
-
, expect_xml=False)
|
|
2263
|
-
|
|
2264
|
-
writer.write_run_thread(hit.thread_id)
|
|
2265
|
-
|
|
2266
|
-
writer.finished_ok = True
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.')
|
|
2270
|
-
def test_show_bytecode_xml(case_setup, tmpdir):
|
|
2271
|
-
from _pydevd_bundle.pydevd_comm_constants import CMD_LOAD_SOURCE_FROM_FRAME_ID
|
|
2272
|
-
|
|
2273
|
-
with case_setup.test_file('_debugger_case_show_bytecode.py') as writer:
|
|
2274
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('breakpoint'))
|
|
2275
|
-
writer.write_make_initial_run()
|
|
2276
|
-
|
|
2277
|
-
# First hit is for breakpoint reached via a stack frame that doesn't have source.
|
|
2278
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
2279
|
-
|
|
2280
|
-
writer.write_get_thread_stack(hit.thread_id)
|
|
2281
|
-
msg = writer.wait_for_get_thread_stack_message()
|
|
2282
|
-
frame_ids = set()
|
|
2283
|
-
for frame in msg.thread.frame:
|
|
2284
|
-
if frame['file'] == '<something>':
|
|
2285
|
-
frame_ids.add(frame['id'])
|
|
2286
|
-
|
|
2287
|
-
assert len(frame_ids) == 2
|
|
2288
|
-
|
|
2289
|
-
for frame_id in frame_ids:
|
|
2290
|
-
writer.write_load_source_from_frame_id(frame_id)
|
|
2291
|
-
writer.wait_for_message(
|
|
2292
|
-
lambda msg:
|
|
2293
|
-
'%s\t' % CMD_LOAD_SOURCE_FROM_FRAME_ID in msg and (
|
|
2294
|
-
"MyClass" in msg or "foo()" in msg
|
|
2295
|
-
)
|
|
2296
|
-
, expect_xml=False)
|
|
2297
|
-
|
|
2298
|
-
writer.write_run_thread(hit.thread_id)
|
|
2299
|
-
|
|
2300
|
-
writer.finished_ok = True
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
def test_evaluate_errors(case_setup):
|
|
2304
|
-
with case_setup.test_file('_debugger_case_local_variables.py') as writer:
|
|
2305
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('Break here'), 'Call')
|
|
2306
|
-
writer.write_make_initial_run()
|
|
2307
|
-
|
|
2308
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
2309
|
-
thread_id = hit.thread_id
|
|
2310
|
-
frame_id = hit.frame_id
|
|
2311
|
-
|
|
2312
|
-
writer.write_evaluate_expression('%s\t%s\t%s' % (thread_id, frame_id, 'LOCAL'), 'name_error')
|
|
2313
|
-
writer.wait_for_evaluation('<var name="name_error" type="NameError"')
|
|
2314
|
-
writer.write_run_thread(thread_id)
|
|
2315
|
-
writer.finished_ok = True
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
def test_list_threads(case_setup):
|
|
2319
|
-
with case_setup.test_file('_debugger_case_local_variables.py') as writer:
|
|
2320
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('Break here'), 'Call')
|
|
2321
|
-
writer.write_make_initial_run()
|
|
2322
|
-
|
|
2323
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
2324
|
-
thread_id = hit.thread_id
|
|
2325
|
-
frame_id = hit.frame_id
|
|
2326
|
-
|
|
2327
|
-
seq = writer.write_list_threads()
|
|
2328
|
-
msg = writer.wait_for_list_threads(seq)
|
|
2329
|
-
assert msg.thread['name'] == 'MainThread'
|
|
2330
|
-
assert msg.thread['id'].startswith('pid')
|
|
2331
|
-
writer.write_run_thread(thread_id)
|
|
2332
|
-
writer.finished_ok = True
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
def test_case_print(case_setup):
|
|
2336
|
-
with case_setup.test_file('_debugger_case_print.py') as writer:
|
|
2337
|
-
writer.write_add_breakpoint(1, 'None')
|
|
2338
|
-
writer.write_make_initial_run()
|
|
2339
|
-
|
|
2340
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
2341
|
-
thread_id = hit.thread_id
|
|
2342
|
-
frame_id = hit.frame_id
|
|
2343
|
-
|
|
2344
|
-
writer.write_run_thread(thread_id)
|
|
2345
|
-
|
|
2346
|
-
writer.finished_ok = True
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Not working on Jython (needs to be investigated).')
|
|
2350
|
-
def test_case_lamdda(case_setup):
|
|
2351
|
-
with case_setup.test_file('_debugger_case_lamda.py') as writer:
|
|
2352
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('Break here'), 'None')
|
|
2353
|
-
writer.write_make_initial_run()
|
|
2354
|
-
|
|
2355
|
-
for _ in range(3): # We'll hit the same breakpoint 3 times.
|
|
2356
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
2357
|
-
|
|
2358
|
-
writer.write_run_thread(hit.thread_id)
|
|
2359
|
-
|
|
2360
|
-
writer.finished_ok = True
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Not working on Jython (needs to be investigated).')
|
|
2364
|
-
def test_case_lamdda_multiline(case_setup):
|
|
2365
|
-
with case_setup.test_file('_debugger_case_lambda_multiline.py') as writer:
|
|
2366
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('Break here'), 'None')
|
|
2367
|
-
writer.write_make_initial_run()
|
|
2368
|
-
|
|
2369
|
-
for _ in range(2): # We'll hit the same breakpoint 2 times.
|
|
2370
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
2371
|
-
|
|
2372
|
-
writer.write_run_thread(hit.thread_id)
|
|
2373
|
-
|
|
2374
|
-
writer.finished_ok = True
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Not working on Jython (needs to be investigated).')
|
|
2378
|
-
def test_case_method_single_line(case_setup):
|
|
2379
|
-
with case_setup.test_file('_debugger_case_method_single_line.py') as writer:
|
|
2380
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('Break here'), 'None')
|
|
2381
|
-
writer.write_make_initial_run()
|
|
2382
|
-
|
|
2383
|
-
for _ in range(3):
|
|
2384
|
-
# We'll hit the same breakpoint 3 times (method creation,
|
|
2385
|
-
# method line for each call).
|
|
2386
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
2387
|
-
|
|
2388
|
-
writer.write_run_thread(hit.thread_id)
|
|
2389
|
-
|
|
2390
|
-
writer.finished_ok = True
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Not working properly on Jython (needs investigation).')
|
|
2394
|
-
def test_case_suspension_policy(case_setup):
|
|
2395
|
-
with case_setup.test_file('_debugger_case_suspend_policy.py') as writer:
|
|
2396
|
-
writer.write_add_breakpoint(25, '', suspend_policy='ALL')
|
|
2397
|
-
writer.write_make_initial_run()
|
|
2398
|
-
|
|
2399
|
-
thread_ids = []
|
|
2400
|
-
for i in range(3):
|
|
2401
|
-
writer.log.append('Waiting for thread %s of 3 to stop' % (i + 1,))
|
|
2402
|
-
# One thread is suspended with a breakpoint hit and the other 2 as thread suspended.
|
|
2403
|
-
hit = writer.wait_for_breakpoint_hit((REASON_STOP_ON_BREAKPOINT, REASON_THREAD_SUSPEND))
|
|
2404
|
-
thread_ids.append(hit.thread_id)
|
|
2405
|
-
|
|
2406
|
-
for thread_id in thread_ids:
|
|
2407
|
-
writer.write_run_thread(thread_id)
|
|
2408
|
-
|
|
2409
|
-
writer.finished_ok = True
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Flaky on Jython (needs investigation).')
|
|
2413
|
-
def test_case_get_thread_stack(case_setup):
|
|
2414
|
-
with case_setup.test_file('_debugger_case_get_thread_stack.py') as writer:
|
|
2415
|
-
|
|
2416
|
-
original_ignore_stderr_line = writer._ignore_stderr_line
|
|
2417
|
-
|
|
2418
|
-
@overrides(writer._ignore_stderr_line)
|
|
2419
|
-
def _ignore_stderr_line(line):
|
|
2420
|
-
if original_ignore_stderr_line(line):
|
|
2421
|
-
return True
|
|
2422
|
-
|
|
2423
|
-
if IS_JYTHON:
|
|
2424
|
-
for expected in (
|
|
2425
|
-
"RuntimeWarning: Parent module '_pydev_bundle' not found while handling absolute import",
|
|
2426
|
-
"from java.lang import System"):
|
|
2427
|
-
if expected in line:
|
|
2428
|
-
return True
|
|
2429
|
-
|
|
2430
|
-
return False
|
|
2431
|
-
|
|
2432
|
-
writer._ignore_stderr_line = _ignore_stderr_line
|
|
2433
|
-
writer.write_add_breakpoint(18, None)
|
|
2434
|
-
writer.write_make_initial_run()
|
|
2435
|
-
|
|
2436
|
-
thread_created_msgs = [writer.wait_for_message(CMD_THREAD_CREATE)]
|
|
2437
|
-
thread_created_msgs.append(writer.wait_for_message(CMD_THREAD_CREATE))
|
|
2438
|
-
thread_id_to_name = {}
|
|
2439
|
-
for msg in thread_created_msgs:
|
|
2440
|
-
thread_id_to_name[msg.thread['id']] = msg.thread['name']
|
|
2441
|
-
assert len(thread_id_to_name) == 2
|
|
2442
|
-
|
|
2443
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT)
|
|
2444
|
-
assert hit.thread_id in thread_id_to_name
|
|
2445
|
-
|
|
2446
|
-
for request_thread_id in thread_id_to_name:
|
|
2447
|
-
writer.write_get_thread_stack(request_thread_id)
|
|
2448
|
-
msg = writer.wait_for_get_thread_stack_message()
|
|
2449
|
-
files = [frame['file'] for frame in msg.thread.frame]
|
|
2450
|
-
assert msg.thread['id'] == request_thread_id
|
|
2451
|
-
if not files[0].endswith('_debugger_case_get_thread_stack.py'):
|
|
2452
|
-
raise AssertionError('Expected to find _debugger_case_get_thread_stack.py in files[0]. Found: %s' % ('\n'.join(files),))
|
|
2453
|
-
|
|
2454
|
-
if ([filename for filename in files if filename.endswith('pydevd.py')]):
|
|
2455
|
-
raise AssertionError('Did not expect to find pydevd.py. Found: %s' % ('\n'.join(files),))
|
|
2456
|
-
if request_thread_id == hit.thread_id:
|
|
2457
|
-
assert len(msg.thread.frame) == 0 # In main thread (must have no back frames).
|
|
2458
|
-
assert msg.thread.frame['name'] == '<module>'
|
|
2459
|
-
else:
|
|
2460
|
-
assert len(msg.thread.frame) > 1 # Stopped in threading (must have back frames).
|
|
2461
|
-
assert msg.thread.frame[0]['name'] == 'method'
|
|
2462
|
-
|
|
2463
|
-
writer.write_run_thread(hit.thread_id)
|
|
2464
|
-
|
|
2465
|
-
writer.finished_ok = True
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
def test_case_dump_threads_to_stderr(case_setup):
|
|
2469
|
-
|
|
2470
|
-
from tests_python.debugger_unittest import wait_for_condition
|
|
2471
|
-
|
|
2472
|
-
def additional_output_checks(writer, stdout, stderr):
|
|
2473
|
-
assert is_stderr_ok(stderr), make_error_msg(stderr)
|
|
2474
|
-
|
|
2475
|
-
def make_error_msg(stderr):
|
|
2476
|
-
return 'Did not find thread dump in stderr. stderr:\n%s' % (stderr,)
|
|
2477
|
-
|
|
2478
|
-
def is_stderr_ok(stderr):
|
|
2479
|
-
return 'Thread Dump' in stderr and 'Thread pydevd.CommandThread (daemon: True, pydevd thread: True)' in stderr
|
|
2480
|
-
|
|
2481
|
-
with case_setup.test_file(
|
|
2482
|
-
'_debugger_case_get_thread_stack.py', additional_output_checks=additional_output_checks) as writer:
|
|
2483
|
-
writer.write_add_breakpoint(12, None)
|
|
2484
|
-
writer.write_make_initial_run()
|
|
2485
|
-
|
|
2486
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT)
|
|
2487
|
-
|
|
2488
|
-
writer.write_dump_threads()
|
|
2489
|
-
wait_for_condition(
|
|
2490
|
-
lambda: is_stderr_ok(writer.get_stderr()),
|
|
2491
|
-
lambda: make_error_msg(writer.get_stderr())
|
|
2492
|
-
)
|
|
2493
|
-
writer.write_run_thread(hit.thread_id)
|
|
2494
|
-
|
|
2495
|
-
writer.finished_ok = True
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
def test_stop_on_start_regular(case_setup):
|
|
2499
|
-
|
|
2500
|
-
with case_setup.test_file('_debugger_case_simple_calls.py') as writer:
|
|
2501
|
-
writer.write_stop_on_start()
|
|
2502
|
-
writer.write_make_initial_run()
|
|
2503
|
-
|
|
2504
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_START, file='_debugger_case_simple_calls.py', line=1)
|
|
2505
|
-
|
|
2506
|
-
writer.write_run_thread(hit.thread_id)
|
|
2507
|
-
|
|
2508
|
-
writer.finished_ok = True
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
def _get_breakpoint_cases():
|
|
2512
|
-
if sys.version_info >= (3, 7):
|
|
2513
|
-
# Just check breakpoint()
|
|
2514
|
-
return ('_debugger_case_breakpoint.py',)
|
|
2515
|
-
else:
|
|
2516
|
-
# Check breakpoint() and sys.__breakpointhook__ replacement.
|
|
2517
|
-
return ('_debugger_case_breakpoint.py', '_debugger_case_breakpoint2.py')
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
@pytest.mark.parametrize("filename", _get_breakpoint_cases())
|
|
2521
|
-
def test_py_37_breakpoint(case_setup, filename):
|
|
2522
|
-
with case_setup.test_file(filename) as writer:
|
|
2523
|
-
writer.write_make_initial_run()
|
|
2524
|
-
|
|
2525
|
-
hit = writer.wait_for_breakpoint_hit(file=filename, line=3)
|
|
2526
|
-
|
|
2527
|
-
writer.write_run_thread(hit.thread_id)
|
|
2528
|
-
|
|
2529
|
-
writer.finished_ok = True
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
def _get_generator_cases():
|
|
2533
|
-
# On py3 we should check both versions.
|
|
2534
|
-
return (
|
|
2535
|
-
'_debugger_case_generator_py2.py',
|
|
2536
|
-
'_debugger_case_generator_py3.py',
|
|
2537
|
-
)
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
@pytest.mark.parametrize("filename", _get_generator_cases())
|
|
2541
|
-
def test_generator_cases(case_setup, filename):
|
|
2542
|
-
with case_setup.test_file(filename) as writer:
|
|
2543
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break here'))
|
|
2544
|
-
writer.write_make_initial_run()
|
|
2545
|
-
|
|
2546
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
2547
|
-
|
|
2548
|
-
writer.write_run_thread(hit.thread_id)
|
|
2549
|
-
|
|
2550
|
-
writer.finished_ok = True
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
def test_stop_on_start_m_switch(case_setup_m_switch):
|
|
2554
|
-
|
|
2555
|
-
with case_setup_m_switch.test_file() as writer:
|
|
2556
|
-
writer.write_stop_on_start()
|
|
2557
|
-
writer.write_make_initial_run()
|
|
2558
|
-
|
|
2559
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_START, file='_debugger_case_m_switch.py', line=1)
|
|
2560
|
-
|
|
2561
|
-
writer.write_run_thread(hit.thread_id)
|
|
2562
|
-
|
|
2563
|
-
writer.finished_ok = True
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
def test_stop_on_start_entry_point(case_setup_m_switch_entry_point):
|
|
2567
|
-
|
|
2568
|
-
with case_setup_m_switch_entry_point.test_file() as writer:
|
|
2569
|
-
writer.write_stop_on_start()
|
|
2570
|
-
writer.write_make_initial_run()
|
|
2571
|
-
|
|
2572
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_START, file='_debugger_case_module_entry_point.py', line=1)
|
|
2573
|
-
|
|
2574
|
-
writer.write_run_thread(hit.thread_id)
|
|
2575
|
-
|
|
2576
|
-
writer.finished_ok = True
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Not working properly on Jython (needs investigation).')
|
|
2580
|
-
def test_debug_zip_files(case_setup, tmpdir):
|
|
2581
|
-
|
|
2582
|
-
def get_environ(writer):
|
|
2583
|
-
env = os.environ.copy()
|
|
2584
|
-
curr_pythonpath = env.get('PYTHONPATH', '')
|
|
2585
|
-
|
|
2586
|
-
curr_pythonpath = str(tmpdir.join('myzip.zip')) + os.pathsep + curr_pythonpath
|
|
2587
|
-
curr_pythonpath = str(tmpdir.join('myzip2.egg!')) + os.pathsep + curr_pythonpath
|
|
2588
|
-
env['PYTHONPATH'] = curr_pythonpath
|
|
2589
|
-
|
|
2590
|
-
env["IDE_PROJECT_ROOTS"] = str(tmpdir.join('myzip.zip'))
|
|
2591
|
-
return env
|
|
2592
|
-
|
|
2593
|
-
import zipfile
|
|
2594
|
-
zip_file = zipfile.ZipFile(
|
|
2595
|
-
str(tmpdir.join('myzip.zip')), 'w')
|
|
2596
|
-
zip_file.writestr('zipped/__init__.py', '')
|
|
2597
|
-
zip_file.writestr('zipped/zipped_contents.py', 'def call_in_zip():\n return 1')
|
|
2598
|
-
zip_file.close()
|
|
2599
|
-
|
|
2600
|
-
zip_file = zipfile.ZipFile(
|
|
2601
|
-
str(tmpdir.join('myzip2.egg!')), 'w')
|
|
2602
|
-
zip_file.writestr('zipped2/__init__.py', '')
|
|
2603
|
-
zip_file.writestr('zipped2/zipped_contents2.py', 'def call_in_zip2():\n return 1')
|
|
2604
|
-
zip_file.close()
|
|
2605
|
-
|
|
2606
|
-
with case_setup.test_file('_debugger_case_zip_files.py', get_environ=get_environ) as writer:
|
|
2607
|
-
writer.write_add_breakpoint(
|
|
2608
|
-
2,
|
|
2609
|
-
'None',
|
|
2610
|
-
filename=os.path.join(str(tmpdir.join('myzip.zip')), 'zipped', 'zipped_contents.py')
|
|
2611
|
-
)
|
|
2612
|
-
|
|
2613
|
-
writer.write_add_breakpoint(
|
|
2614
|
-
2,
|
|
2615
|
-
'None',
|
|
2616
|
-
filename=os.path.join(str(tmpdir.join('myzip2.egg!')), 'zipped2', 'zipped_contents2.py')
|
|
2617
|
-
)
|
|
2618
|
-
|
|
2619
|
-
writer.write_make_initial_run()
|
|
2620
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
2621
|
-
assert hit.name == 'call_in_zip'
|
|
2622
|
-
writer.write_run_thread(hit.thread_id)
|
|
2623
|
-
|
|
2624
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
2625
|
-
assert hit.name == 'call_in_zip2'
|
|
2626
|
-
writer.write_run_thread(hit.thread_id)
|
|
2627
|
-
|
|
2628
|
-
writer.finished_ok = True
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.')
|
|
2632
|
-
@pytest.mark.parametrize('file_to_check', [
|
|
2633
|
-
'_debugger_case_multiprocessing_2.py',
|
|
2634
|
-
'_debugger_case_multiprocessing.py',
|
|
2635
|
-
'_debugger_case_python_c.py',
|
|
2636
|
-
'_debugger_case_multiprocessing_pool.py'
|
|
2637
|
-
])
|
|
2638
|
-
def test_multiprocessing_simple(case_setup_multiprocessing, file_to_check):
|
|
2639
|
-
import threading
|
|
2640
|
-
from tests_python.debugger_unittest import AbstractWriterThread
|
|
2641
|
-
with case_setup_multiprocessing.test_file(file_to_check) as writer:
|
|
2642
|
-
break1_line = writer.get_line_index_with_content('break 1 here')
|
|
2643
|
-
break2_line = writer.get_line_index_with_content('break 2 here')
|
|
2644
|
-
|
|
2645
|
-
writer.write_add_breakpoint(break1_line)
|
|
2646
|
-
writer.write_add_breakpoint(break2_line)
|
|
2647
|
-
|
|
2648
|
-
server_socket = writer.server_socket
|
|
2649
|
-
|
|
2650
|
-
class SecondaryProcessWriterThread(AbstractWriterThread):
|
|
2651
|
-
|
|
2652
|
-
TEST_FILE = writer.get_main_filename()
|
|
2653
|
-
_sequence = -1
|
|
2654
|
-
|
|
2655
|
-
class SecondaryProcessThreadCommunication(threading.Thread):
|
|
2656
|
-
|
|
2657
|
-
def run(self):
|
|
2658
|
-
from tests_python.debugger_unittest import ReaderThread
|
|
2659
|
-
expected_connections = 1
|
|
2660
|
-
|
|
2661
|
-
for _ in range(expected_connections):
|
|
2662
|
-
server_socket.listen(1)
|
|
2663
|
-
self.server_socket = server_socket
|
|
2664
|
-
new_sock, addr = server_socket.accept()
|
|
2665
|
-
|
|
2666
|
-
reader_thread = ReaderThread(new_sock)
|
|
2667
|
-
reader_thread.name = ' *** Multiprocess Reader Thread'
|
|
2668
|
-
reader_thread.start()
|
|
2669
|
-
|
|
2670
|
-
writer2 = SecondaryProcessWriterThread()
|
|
2671
|
-
|
|
2672
|
-
writer2.reader_thread = reader_thread
|
|
2673
|
-
writer2.sock = new_sock
|
|
2674
|
-
|
|
2675
|
-
writer2.write_version()
|
|
2676
|
-
writer2.write_add_breakpoint(break1_line)
|
|
2677
|
-
writer2.write_add_breakpoint(break2_line)
|
|
2678
|
-
writer2.write_make_initial_run()
|
|
2679
|
-
|
|
2680
|
-
hit = writer2.wait_for_breakpoint_hit()
|
|
2681
|
-
writer2.write_run_thread(hit.thread_id)
|
|
2682
|
-
|
|
2683
|
-
secondary_process_thread_communication = SecondaryProcessThreadCommunication()
|
|
2684
|
-
secondary_process_thread_communication.start()
|
|
2685
|
-
writer.write_make_initial_run()
|
|
2686
|
-
hit2 = writer.wait_for_breakpoint_hit()
|
|
2687
|
-
secondary_process_thread_communication.join(10)
|
|
2688
|
-
if secondary_process_thread_communication.is_alive():
|
|
2689
|
-
raise AssertionError('The SecondaryProcessThreadCommunication did not finish')
|
|
2690
|
-
writer.write_run_thread(hit2.thread_id)
|
|
2691
|
-
writer.finished_ok = True
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.')
|
|
2695
|
-
@pytest.mark.parametrize('count', range(5)) # Call multiple times to exercise timing issues.
|
|
2696
|
-
def test_multiprocessing_with_stopped_breakpoints(case_setup_multiprocessing, count, debugger_runner_simple):
|
|
2697
|
-
import threading
|
|
2698
|
-
from tests_python.debugger_unittest import AbstractWriterThread
|
|
2699
|
-
with case_setup_multiprocessing.test_file('_debugger_case_multiprocessing_stopped_threads.py') as writer:
|
|
2700
|
-
break_main_line = writer.get_line_index_with_content('break in main here')
|
|
2701
|
-
break_thread_line = writer.get_line_index_with_content('break in thread here')
|
|
2702
|
-
break_process_line = writer.get_line_index_with_content('break in process here')
|
|
2703
|
-
|
|
2704
|
-
writer.write_add_breakpoint(break_main_line)
|
|
2705
|
-
writer.write_add_breakpoint(break_thread_line)
|
|
2706
|
-
writer.write_add_breakpoint(break_process_line)
|
|
2707
|
-
|
|
2708
|
-
server_socket = writer.server_socket
|
|
2709
|
-
listening_event = threading.Event()
|
|
2710
|
-
|
|
2711
|
-
class SecondaryProcessWriterThread(AbstractWriterThread):
|
|
2712
|
-
|
|
2713
|
-
TEST_FILE = writer.get_main_filename()
|
|
2714
|
-
_sequence = -1
|
|
2715
|
-
|
|
2716
|
-
class SecondaryProcessThreadCommunication(threading.Thread):
|
|
2717
|
-
|
|
2718
|
-
def run(self):
|
|
2719
|
-
from tests_python.debugger_unittest import ReaderThread
|
|
2720
|
-
server_socket.listen(1)
|
|
2721
|
-
self.server_socket = server_socket
|
|
2722
|
-
listening_event.set()
|
|
2723
|
-
writer.log.append(' *** Multiprocess waiting on server_socket.accept()')
|
|
2724
|
-
new_sock, addr = server_socket.accept()
|
|
2725
|
-
|
|
2726
|
-
reader_thread = ReaderThread(new_sock)
|
|
2727
|
-
reader_thread.name = ' *** Multiprocess Reader Thread'
|
|
2728
|
-
reader_thread.start()
|
|
2729
|
-
writer.log.append(' *** Multiprocess started ReaderThread')
|
|
2730
|
-
|
|
2731
|
-
writer2 = SecondaryProcessWriterThread()
|
|
2732
|
-
writer2._WRITE_LOG_PREFIX = ' *** Multiprocess write: '
|
|
2733
|
-
writer2.log = writer.log
|
|
2734
|
-
|
|
2735
|
-
writer2.reader_thread = reader_thread
|
|
2736
|
-
writer2.sock = new_sock
|
|
2737
|
-
|
|
2738
|
-
writer2.write_version()
|
|
2739
|
-
writer2.write_add_breakpoint(break_main_line)
|
|
2740
|
-
writer2.write_add_breakpoint(break_thread_line)
|
|
2741
|
-
writer2.write_add_breakpoint(break_process_line)
|
|
2742
|
-
writer2.write_make_initial_run()
|
|
2743
|
-
hit = writer2.wait_for_breakpoint_hit()
|
|
2744
|
-
writer2.write_run_thread(hit.thread_id)
|
|
2745
|
-
|
|
2746
|
-
secondary_process_thread_communication = SecondaryProcessThreadCommunication()
|
|
2747
|
-
secondary_process_thread_communication.start()
|
|
2748
|
-
|
|
2749
|
-
ok = listening_event.wait(timeout=10)
|
|
2750
|
-
assert ok
|
|
2751
|
-
writer.write_make_initial_run()
|
|
2752
|
-
hit2 = writer.wait_for_breakpoint_hit() # Breaks in thread.
|
|
2753
|
-
writer.write_step_over(hit2.thread_id)
|
|
2754
|
-
|
|
2755
|
-
hit2 = writer.wait_for_breakpoint_hit(REASON_STEP_OVER) # line == event.set()
|
|
2756
|
-
|
|
2757
|
-
# paused on breakpoint, will start process and pause on main thread
|
|
2758
|
-
# in the main process too.
|
|
2759
|
-
writer.write_step_over(hit2.thread_id)
|
|
2760
|
-
|
|
2761
|
-
# Note: ignore the step over hit (go only for the breakpoint hit).
|
|
2762
|
-
main_hit = writer.wait_for_breakpoint_hit(REASON_STOP_ON_BREAKPOINT)
|
|
2763
|
-
|
|
2764
|
-
secondary_process_thread_communication.join(10)
|
|
2765
|
-
if secondary_process_thread_communication.is_alive():
|
|
2766
|
-
raise AssertionError('The SecondaryProcessThreadCommunication did not finish')
|
|
2767
|
-
|
|
2768
|
-
writer.write_run_thread(hit2.thread_id)
|
|
2769
|
-
writer.write_run_thread(main_hit.thread_id)
|
|
2770
|
-
|
|
2771
|
-
# We must have found at least 2 debug files when doing multiprocessing (one for
|
|
2772
|
-
# each pid).
|
|
2773
|
-
assert len(pydev_log.list_log_files(debugger_runner_simple.pydevd_debug_file)) == 2
|
|
2774
|
-
writer.finished_ok = True
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.')
|
|
2778
|
-
@pytest.mark.parametrize('target', [
|
|
2779
|
-
'_debugger_case_quoting.py',
|
|
2780
|
-
'_debugger_case_subprocess_zip.py'
|
|
2781
|
-
])
|
|
2782
|
-
def test_subprocess_quoted_args(case_setup_multiprocessing, target):
|
|
2783
|
-
from tests_python.debugger_unittest import AbstractWriterThread
|
|
2784
|
-
with case_setup_multiprocessing.test_file(target) as writer:
|
|
2785
|
-
break_subprocess_line = writer.get_line_index_with_content('break here')
|
|
2786
|
-
|
|
2787
|
-
writer.write_add_breakpoint(break_subprocess_line)
|
|
2788
|
-
|
|
2789
|
-
server_socket = writer.server_socket
|
|
2790
|
-
|
|
2791
|
-
class SecondaryProcessWriterThread(AbstractWriterThread):
|
|
2792
|
-
|
|
2793
|
-
TEST_FILE = writer.get_main_filename()
|
|
2794
|
-
_sequence = -1
|
|
2795
|
-
|
|
2796
|
-
class SecondaryProcessThreadCommunication(threading.Thread):
|
|
2797
|
-
|
|
2798
|
-
def run(self):
|
|
2799
|
-
from tests_python.debugger_unittest import ReaderThread
|
|
2800
|
-
# Note: on linux on Python 2 because on Python 2 CPython subprocess.call will actually
|
|
2801
|
-
# create a fork first (at which point it'll connect) and then, later on it'll
|
|
2802
|
-
# call the main (as if it was a clean process as if PyDB wasn't created
|
|
2803
|
-
# the first time -- the debugger will still work, but it'll do an additional
|
|
2804
|
-
# connection.
|
|
2805
|
-
|
|
2806
|
-
expected_connections = 1
|
|
2807
|
-
|
|
2808
|
-
for _ in range(expected_connections):
|
|
2809
|
-
server_socket.listen(1)
|
|
2810
|
-
self.server_socket = server_socket
|
|
2811
|
-
new_sock, addr = server_socket.accept()
|
|
2812
|
-
|
|
2813
|
-
reader_thread = ReaderThread(new_sock)
|
|
2814
|
-
reader_thread.name = ' *** Multiprocess Reader Thread'
|
|
2815
|
-
reader_thread.start()
|
|
2816
|
-
|
|
2817
|
-
writer2 = SecondaryProcessWriterThread()
|
|
2818
|
-
|
|
2819
|
-
writer2.reader_thread = reader_thread
|
|
2820
|
-
writer2.sock = new_sock
|
|
2821
|
-
|
|
2822
|
-
writer2.write_version()
|
|
2823
|
-
writer2.write_add_breakpoint(break_subprocess_line)
|
|
2824
|
-
writer2.write_make_initial_run()
|
|
2825
|
-
hit = writer2.wait_for_breakpoint_hit()
|
|
2826
|
-
writer2.write_run_thread(hit.thread_id)
|
|
2827
|
-
|
|
2828
|
-
secondary_process_thread_communication = SecondaryProcessThreadCommunication()
|
|
2829
|
-
secondary_process_thread_communication.start()
|
|
2830
|
-
writer.write_make_initial_run()
|
|
2831
|
-
|
|
2832
|
-
secondary_process_thread_communication.join(10)
|
|
2833
|
-
if secondary_process_thread_communication.is_alive():
|
|
2834
|
-
raise AssertionError('The SecondaryProcessThreadCommunication did not finish')
|
|
2835
|
-
|
|
2836
|
-
writer.finished_ok = True
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
def _attach_to_writer_pid(writer):
|
|
2840
|
-
import pydevd
|
|
2841
|
-
assert writer.process is not None
|
|
2842
|
-
|
|
2843
|
-
def attach():
|
|
2844
|
-
attach_pydevd_file = os.path.join(os.path.dirname(pydevd.__file__), 'pydevd_attach_to_process', 'attach_pydevd.py')
|
|
2845
|
-
subprocess.call([sys.executable, attach_pydevd_file, '--pid', str(writer.process.pid), '--port', str(writer.port)])
|
|
2846
|
-
|
|
2847
|
-
threading.Thread(target=attach).start()
|
|
2848
|
-
|
|
2849
|
-
wait_for_condition(lambda: writer.finished_initialization)
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
@pytest.mark.skipif(not IS_CPYTHON or IS_MAC, reason='CPython only test (brittle on Mac).')
|
|
2853
|
-
@pytest.mark.parametrize('reattach', [True, False])
|
|
2854
|
-
def test_attach_to_pid_no_threads(case_setup_remote, reattach):
|
|
2855
|
-
with case_setup_remote.test_file('_debugger_case_attach_to_pid_simple.py', wait_for_port=False) as writer:
|
|
2856
|
-
time.sleep(1) # Give it some time to initialize to get to the while loop.
|
|
2857
|
-
_attach_to_writer_pid(writer)
|
|
2858
|
-
|
|
2859
|
-
bp_line = writer.get_line_index_with_content('break here')
|
|
2860
|
-
bp_id = writer.write_add_breakpoint(bp_line)
|
|
2861
|
-
writer.write_make_initial_run()
|
|
2862
|
-
|
|
2863
|
-
hit = writer.wait_for_breakpoint_hit(line=bp_line)
|
|
2864
|
-
|
|
2865
|
-
if reattach:
|
|
2866
|
-
# This would be the same as a second attach to pid, so, the idea is closing the current
|
|
2867
|
-
# connection and then doing a new attach to pid.
|
|
2868
|
-
writer.write_remove_breakpoint(bp_id)
|
|
2869
|
-
writer.write_run_thread(hit.thread_id)
|
|
2870
|
-
|
|
2871
|
-
writer.do_kill() # This will simply close the open sockets without doing anything else.
|
|
2872
|
-
time.sleep(1)
|
|
2873
|
-
|
|
2874
|
-
t = threading.Thread(target=writer.start_socket)
|
|
2875
|
-
t.start()
|
|
2876
|
-
wait_for_condition(lambda: hasattr(writer, 'port'))
|
|
2877
|
-
time.sleep(1)
|
|
2878
|
-
writer.process = writer.process
|
|
2879
|
-
_attach_to_writer_pid(writer)
|
|
2880
|
-
wait_for_condition(lambda: hasattr(writer, 'reader_thread'))
|
|
2881
|
-
time.sleep(1)
|
|
2882
|
-
|
|
2883
|
-
bp_id = writer.write_add_breakpoint(bp_line)
|
|
2884
|
-
writer.write_make_initial_run()
|
|
2885
|
-
|
|
2886
|
-
hit = writer.wait_for_breakpoint_hit(line=bp_line)
|
|
2887
|
-
|
|
2888
|
-
writer.write_change_variable(hit.thread_id, hit.frame_id, 'wait', 'False')
|
|
2889
|
-
writer.wait_for_var('<xml><var name="" type="bool"')
|
|
2890
|
-
|
|
2891
|
-
writer.write_run_thread(hit.thread_id)
|
|
2892
|
-
|
|
2893
|
-
writer.finished_ok = True
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
@pytest.mark.skipif(not IS_CPYTHON or IS_MAC, reason='CPython only test (brittle on Mac).')
|
|
2897
|
-
def test_attach_to_pid_halted(case_setup_remote):
|
|
2898
|
-
with case_setup_remote.test_file('_debugger_case_attach_to_pid_multiple_threads.py', wait_for_port=False) as writer:
|
|
2899
|
-
time.sleep(1) # Give it some time to initialize and get to the proper halting condition
|
|
2900
|
-
_attach_to_writer_pid(writer)
|
|
2901
|
-
|
|
2902
|
-
bp_line = writer.get_line_index_with_content('break thread here')
|
|
2903
|
-
writer.write_add_breakpoint(bp_line)
|
|
2904
|
-
writer.write_make_initial_run()
|
|
2905
|
-
|
|
2906
|
-
hit = writer.wait_for_breakpoint_hit(line=bp_line)
|
|
2907
|
-
|
|
2908
|
-
writer.write_change_variable(hit.thread_id, hit.frame_id, 'wait', 'False')
|
|
2909
|
-
writer.wait_for_var('<xml><var name="" type="bool"')
|
|
2910
|
-
|
|
2911
|
-
writer.write_run_thread(hit.thread_id)
|
|
2912
|
-
|
|
2913
|
-
writer.finished_ok = True
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.')
|
|
2917
|
-
def test_remote_debugger_basic(case_setup_remote):
|
|
2918
|
-
with case_setup_remote.test_file('_debugger_case_remote.py') as writer:
|
|
2919
|
-
writer.log.append('making initial run')
|
|
2920
|
-
writer.write_make_initial_run()
|
|
2921
|
-
|
|
2922
|
-
writer.log.append('waiting for breakpoint hit')
|
|
2923
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
2924
|
-
|
|
2925
|
-
writer.log.append('run thread')
|
|
2926
|
-
writer.write_run_thread(hit.thread_id)
|
|
2927
|
-
|
|
2928
|
-
writer.log.append('asserting')
|
|
2929
|
-
try:
|
|
2930
|
-
assert 5 == writer._sequence, 'Expected 5. Had: %s' % writer._sequence
|
|
2931
|
-
except:
|
|
2932
|
-
writer.log.append('assert failed!')
|
|
2933
|
-
raise
|
|
2934
|
-
writer.log.append('asserted')
|
|
2935
|
-
|
|
2936
|
-
writer.finished_ok = True
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.')
|
|
2940
|
-
def test_remote_debugger_threads(case_setup_remote):
|
|
2941
|
-
with case_setup_remote.test_file('_debugger_case_remote_threads.py') as writer:
|
|
2942
|
-
writer.write_make_initial_run()
|
|
2943
|
-
|
|
2944
|
-
hit_in_main = writer.wait_for_breakpoint_hit()
|
|
2945
|
-
|
|
2946
|
-
bp_line = writer.get_line_index_with_content('break here')
|
|
2947
|
-
writer.write_add_breakpoint(bp_line)
|
|
2948
|
-
|
|
2949
|
-
# Break in the 2 threads.
|
|
2950
|
-
hit_in_thread1 = writer.wait_for_breakpoint_hit(line=bp_line)
|
|
2951
|
-
hit_in_thread2 = writer.wait_for_breakpoint_hit(line=bp_line)
|
|
2952
|
-
|
|
2953
|
-
writer.write_change_variable(hit_in_thread1.thread_id, hit_in_thread1.frame_id, 'wait', 'False')
|
|
2954
|
-
writer.wait_for_var('<xml><var name="" type="bool"')
|
|
2955
|
-
writer.write_change_variable(hit_in_thread2.thread_id, hit_in_thread2.frame_id, 'wait', 'False')
|
|
2956
|
-
writer.wait_for_var('<xml><var name="" type="bool"')
|
|
2957
|
-
|
|
2958
|
-
writer.write_run_thread(hit_in_main.thread_id)
|
|
2959
|
-
writer.write_run_thread(hit_in_thread1.thread_id)
|
|
2960
|
-
writer.write_run_thread(hit_in_thread2.thread_id)
|
|
2961
|
-
|
|
2962
|
-
writer.finished_ok = True
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.')
|
|
2966
|
-
def test_py_37_breakpoint_remote(case_setup_remote):
|
|
2967
|
-
with case_setup_remote.test_file('_debugger_case_breakpoint_remote.py') as writer:
|
|
2968
|
-
writer.write_make_initial_run()
|
|
2969
|
-
|
|
2970
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
2971
|
-
filename='_debugger_case_breakpoint_remote.py',
|
|
2972
|
-
line=13,
|
|
2973
|
-
)
|
|
2974
|
-
|
|
2975
|
-
writer.write_run_thread(hit.thread_id)
|
|
2976
|
-
|
|
2977
|
-
try:
|
|
2978
|
-
assert 5 == writer._sequence, 'Expected 5. Had: %s' % writer._sequence
|
|
2979
|
-
except:
|
|
2980
|
-
writer.log.append('assert failed!')
|
|
2981
|
-
raise
|
|
2982
|
-
writer.log.append('asserted')
|
|
2983
|
-
|
|
2984
|
-
writer.finished_ok = True
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.')
|
|
2988
|
-
def test_py_37_breakpoint_remote_no_import(case_setup_remote):
|
|
2989
|
-
|
|
2990
|
-
def get_environ(writer):
|
|
2991
|
-
env = os.environ.copy()
|
|
2992
|
-
curr_pythonpath = env.get('PYTHONPATH', '')
|
|
2993
|
-
|
|
2994
|
-
pydevd_dirname = os.path.join(
|
|
2995
|
-
os.path.dirname(writer.get_pydevd_file()),
|
|
2996
|
-
'pydev_sitecustomize')
|
|
2997
|
-
|
|
2998
|
-
curr_pythonpath = pydevd_dirname + os.pathsep + curr_pythonpath
|
|
2999
|
-
env['PYTHONPATH'] = curr_pythonpath
|
|
3000
|
-
return env
|
|
3001
|
-
|
|
3002
|
-
with case_setup_remote.test_file(
|
|
3003
|
-
'_debugger_case_breakpoint_remote_no_import.py',
|
|
3004
|
-
get_environ=get_environ) as writer:
|
|
3005
|
-
writer.write_make_initial_run()
|
|
3006
|
-
|
|
3007
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
3008
|
-
"108",
|
|
3009
|
-
filename='_debugger_case_breakpoint_remote_no_import.py',
|
|
3010
|
-
line=12,
|
|
3011
|
-
)
|
|
3012
|
-
|
|
3013
|
-
writer.write_run_thread(hit.thread_id)
|
|
3014
|
-
|
|
3015
|
-
try:
|
|
3016
|
-
assert 5 == writer._sequence, 'Expected 5. Had: %s' % writer._sequence
|
|
3017
|
-
except:
|
|
3018
|
-
writer.log.append('assert failed!')
|
|
3019
|
-
raise
|
|
3020
|
-
writer.log.append('asserted')
|
|
3021
|
-
|
|
3022
|
-
writer.finished_ok = True
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.')
|
|
3026
|
-
@pytest.mark.parametrize('authenticate', [True, False])
|
|
3027
|
-
def test_remote_debugger_multi_proc(case_setup_remote, authenticate):
|
|
3028
|
-
|
|
3029
|
-
access_token = None
|
|
3030
|
-
client_access_token = None
|
|
3031
|
-
if authenticate:
|
|
3032
|
-
access_token = 'tok123'
|
|
3033
|
-
client_access_token = 'tok456'
|
|
3034
|
-
|
|
3035
|
-
class _SecondaryMultiProcProcessWriterThread(debugger_unittest.AbstractWriterThread):
|
|
3036
|
-
|
|
3037
|
-
FORCE_KILL_PROCESS_WHEN_FINISHED_OK = True
|
|
3038
|
-
|
|
3039
|
-
def __init__(self, server_socket):
|
|
3040
|
-
debugger_unittest.AbstractWriterThread.__init__(self)
|
|
3041
|
-
self.server_socket = server_socket
|
|
3042
|
-
|
|
3043
|
-
def run(self):
|
|
3044
|
-
print('waiting for second process')
|
|
3045
|
-
self.sock, addr = self.server_socket.accept()
|
|
3046
|
-
print('accepted second process')
|
|
3047
|
-
|
|
3048
|
-
from tests_python.debugger_unittest import ReaderThread
|
|
3049
|
-
self.reader_thread = ReaderThread(self.sock)
|
|
3050
|
-
self.reader_thread.name = 'Secondary Reader Thread'
|
|
3051
|
-
self.reader_thread.start()
|
|
3052
|
-
|
|
3053
|
-
self._sequence = -1
|
|
3054
|
-
# initial command is always the version
|
|
3055
|
-
self.write_version()
|
|
3056
|
-
|
|
3057
|
-
if authenticate:
|
|
3058
|
-
self.wait_for_message(lambda msg:'Client not authenticated.' in msg, expect_xml=False)
|
|
3059
|
-
self.write_authenticate(access_token=access_token, client_access_token=client_access_token)
|
|
3060
|
-
self.write_version()
|
|
3061
|
-
|
|
3062
|
-
self.log.append('start_socket')
|
|
3063
|
-
self.write_make_initial_run()
|
|
3064
|
-
time.sleep(.5)
|
|
3065
|
-
self.finished_ok = True
|
|
3066
|
-
|
|
3067
|
-
def do_kill(writer):
|
|
3068
|
-
debugger_unittest.AbstractWriterThread.do_kill(writer)
|
|
3069
|
-
if hasattr(writer, 'secondary_multi_proc_process_writer'):
|
|
3070
|
-
writer.secondary_multi_proc_process_writer.do_kill()
|
|
3071
|
-
|
|
3072
|
-
with case_setup_remote.test_file(
|
|
3073
|
-
'_debugger_case_remote_1.py',
|
|
3074
|
-
do_kill=do_kill,
|
|
3075
|
-
EXPECTED_RETURNCODE='any',
|
|
3076
|
-
access_token=access_token,
|
|
3077
|
-
client_access_token=client_access_token,
|
|
3078
|
-
) as writer:
|
|
3079
|
-
|
|
3080
|
-
# It seems sometimes it becomes flaky on the ci because the process outlives the writer thread...
|
|
3081
|
-
# As we're only interested in knowing if a second connection was received, just kill the related
|
|
3082
|
-
# process.
|
|
3083
|
-
assert hasattr(writer, 'FORCE_KILL_PROCESS_WHEN_FINISHED_OK')
|
|
3084
|
-
writer.FORCE_KILL_PROCESS_WHEN_FINISHED_OK = True
|
|
3085
|
-
|
|
3086
|
-
writer.log.append('making initial run')
|
|
3087
|
-
writer.write_make_initial_run()
|
|
3088
|
-
|
|
3089
|
-
if authenticate:
|
|
3090
|
-
writer.wait_for_message(lambda msg:'Client not authenticated.' in msg, expect_xml=False)
|
|
3091
|
-
writer.write_authenticate(access_token=access_token, client_access_token=client_access_token)
|
|
3092
|
-
writer.write_make_initial_run()
|
|
3093
|
-
|
|
3094
|
-
writer.log.append('waiting for breakpoint hit')
|
|
3095
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
3096
|
-
|
|
3097
|
-
writer.secondary_multi_proc_process_writer = secondary_multi_proc_process_writer = \
|
|
3098
|
-
_SecondaryMultiProcProcessWriterThread(writer.server_socket)
|
|
3099
|
-
secondary_multi_proc_process_writer.start()
|
|
3100
|
-
|
|
3101
|
-
writer.log.append('run thread')
|
|
3102
|
-
writer.write_run_thread(hit.thread_id)
|
|
3103
|
-
|
|
3104
|
-
for _i in range(400):
|
|
3105
|
-
if secondary_multi_proc_process_writer.finished_ok:
|
|
3106
|
-
break
|
|
3107
|
-
time.sleep(.1)
|
|
3108
|
-
else:
|
|
3109
|
-
writer.log.append('Secondary process not finished ok!')
|
|
3110
|
-
raise AssertionError('Secondary process not finished ok!')
|
|
3111
|
-
|
|
3112
|
-
writer.log.append('Secondary process finished!')
|
|
3113
|
-
try:
|
|
3114
|
-
assert writer._sequence == 5 if not authenticate else 9, 'Found: %s' % writer._sequence
|
|
3115
|
-
except:
|
|
3116
|
-
writer.log.append('assert failed!')
|
|
3117
|
-
raise
|
|
3118
|
-
writer.log.append('asserted')
|
|
3119
|
-
|
|
3120
|
-
writer.finished_ok = True
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
@pytest.mark.parametrize('handle', [True, False])
|
|
3124
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.')
|
|
3125
|
-
def test_remote_unhandled_exceptions(case_setup_remote, handle):
|
|
3126
|
-
|
|
3127
|
-
def check_test_suceeded_msg(writer, stdout, stderr):
|
|
3128
|
-
return 'TEST SUCEEDED' in ''.join(stderr)
|
|
3129
|
-
|
|
3130
|
-
def additional_output_checks(writer, stdout, stderr):
|
|
3131
|
-
# Don't call super as we have an expected exception
|
|
3132
|
-
assert 'ValueError: TEST SUCEEDED' in stderr
|
|
3133
|
-
|
|
3134
|
-
with case_setup_remote.test_file(
|
|
3135
|
-
'_debugger_case_remote_unhandled_exceptions.py',
|
|
3136
|
-
additional_output_checks=additional_output_checks,
|
|
3137
|
-
check_test_suceeded_msg=check_test_suceeded_msg,
|
|
3138
|
-
EXPECTED_RETURNCODE=1) as writer:
|
|
3139
|
-
|
|
3140
|
-
writer.log.append('making initial run')
|
|
3141
|
-
writer.write_make_initial_run()
|
|
3142
|
-
|
|
3143
|
-
writer.log.append('waiting for breakpoint hit')
|
|
3144
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
3145
|
-
|
|
3146
|
-
# Add, remove and add back
|
|
3147
|
-
writer.write_add_exception_breakpoint_with_policy('Exception', '0', '1', '0')
|
|
3148
|
-
writer.write_remove_exception_breakpoint('Exception')
|
|
3149
|
-
writer.write_add_exception_breakpoint_with_policy('Exception', '0', '1', '0')
|
|
3150
|
-
|
|
3151
|
-
if not handle:
|
|
3152
|
-
writer.write_remove_exception_breakpoint('Exception')
|
|
3153
|
-
|
|
3154
|
-
writer.log.append('run thread')
|
|
3155
|
-
writer.write_run_thread(hit.thread_id)
|
|
3156
|
-
|
|
3157
|
-
if handle:
|
|
3158
|
-
writer.log.append('waiting for uncaught exception')
|
|
3159
|
-
hit = writer.wait_for_breakpoint_hit(REASON_UNCAUGHT_EXCEPTION)
|
|
3160
|
-
writer.write_run_thread(hit.thread_id)
|
|
3161
|
-
|
|
3162
|
-
writer.log.append('finished ok')
|
|
3163
|
-
writer.finished_ok = True
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
def test_trace_dispatch_correct(case_setup):
|
|
3167
|
-
|
|
3168
|
-
def get_environ(writer):
|
|
3169
|
-
env = os.environ.copy()
|
|
3170
|
-
env['PYDEVD_USE_FRAME_EVAL'] = 'NO' # This test checks trace dispatch (so, disable frame eval).
|
|
3171
|
-
return env
|
|
3172
|
-
|
|
3173
|
-
with case_setup.test_file('_debugger_case_trace_dispatch.py', get_environ=get_environ) as writer:
|
|
3174
|
-
breakpoint_id = writer.write_add_breakpoint(5, 'method')
|
|
3175
|
-
writer.write_make_initial_run()
|
|
3176
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
3177
|
-
writer.write_remove_breakpoint(breakpoint_id)
|
|
3178
|
-
writer.write_run_thread(hit.thread_id)
|
|
3179
|
-
writer.finished_ok = True
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
def test_case_single_notification_on_step(case_setup):
|
|
3183
|
-
from tests_python.debugger_unittest import REASON_STEP_INTO
|
|
3184
|
-
with case_setup.test_file('_debugger_case_import_main.py') as writer:
|
|
3185
|
-
writer.write_multi_threads_single_notification(True)
|
|
3186
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break here'), '')
|
|
3187
|
-
writer.write_make_initial_run()
|
|
3188
|
-
|
|
3189
|
-
hit = writer.wait_for_single_notification_as_hit()
|
|
3190
|
-
|
|
3191
|
-
writer.write_step_in(hit.thread_id)
|
|
3192
|
-
hit = writer.wait_for_single_notification_as_hit(reason=REASON_STEP_INTO)
|
|
3193
|
-
|
|
3194
|
-
writer.write_step_in(hit.thread_id)
|
|
3195
|
-
hit = writer.wait_for_single_notification_as_hit(reason=REASON_STEP_INTO)
|
|
3196
|
-
|
|
3197
|
-
writer.write_step_in(hit.thread_id)
|
|
3198
|
-
hit = writer.wait_for_single_notification_as_hit(reason=REASON_STEP_INTO)
|
|
3199
|
-
|
|
3200
|
-
writer.write_run_thread(hit.thread_id)
|
|
3201
|
-
|
|
3202
|
-
writer.finished_ok = True
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Not ok for Jython.')
|
|
3206
|
-
def test_reload(case_setup, tmpdir):
|
|
3207
|
-
|
|
3208
|
-
path = tmpdir.join('my_temp.py')
|
|
3209
|
-
path.write('''
|
|
3210
|
-
import my_temp2
|
|
3211
|
-
assert my_temp2.call() == 1
|
|
3212
|
-
a = 10 # break here
|
|
3213
|
-
assert my_temp2.call() == 2
|
|
3214
|
-
print('TEST SUCEEDED!')
|
|
3215
|
-
''')
|
|
3216
|
-
|
|
3217
|
-
path2 = tmpdir.join('my_temp2.py')
|
|
3218
|
-
path2.write('''
|
|
3219
|
-
def call():
|
|
3220
|
-
return 1
|
|
3221
|
-
''')
|
|
3222
|
-
with case_setup.test_file(str(path)) as writer:
|
|
3223
|
-
break_line = writer.get_line_index_with_content('break here')
|
|
3224
|
-
writer.write_add_breakpoint(break_line, '')
|
|
3225
|
-
writer.write_make_initial_run()
|
|
3226
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
3227
|
-
|
|
3228
|
-
path2 = tmpdir.join('my_temp2.py')
|
|
3229
|
-
path2.write('''
|
|
3230
|
-
def call():
|
|
3231
|
-
return 2
|
|
3232
|
-
''')
|
|
3233
|
-
|
|
3234
|
-
writer.write_reload('my_temp2')
|
|
3235
|
-
output = writer.wait_for_output()
|
|
3236
|
-
output2 = writer.wait_for_output()
|
|
3237
|
-
output3 = writer.wait_for_output()
|
|
3238
|
-
|
|
3239
|
-
assert output[0].startswith('code reload: Start reloading module: "my_temp2"')
|
|
3240
|
-
assert output2[0].startswith('code reload: Updated function code:')
|
|
3241
|
-
assert output3[0].startswith('code reload: reload finished')
|
|
3242
|
-
assert output[1] == 'stderr'
|
|
3243
|
-
assert output2[1] == 'stderr'
|
|
3244
|
-
assert output3[1] == 'stderr'
|
|
3245
|
-
|
|
3246
|
-
writer.wait_for_message(CMD_RELOAD_CODE)
|
|
3247
|
-
writer.write_run_thread(hit.thread_id)
|
|
3248
|
-
writer.finished_ok = True
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Not working with Jython on ci (needs investigation).')
|
|
3252
|
-
def test_custom_frames(case_setup):
|
|
3253
|
-
with case_setup.test_file('_debugger_case_custom_frames.py') as writer:
|
|
3254
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break here'))
|
|
3255
|
-
writer.write_make_initial_run()
|
|
3256
|
-
|
|
3257
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
3258
|
-
|
|
3259
|
-
for i in range(3):
|
|
3260
|
-
writer.write_step_over(hit.thread_id)
|
|
3261
|
-
|
|
3262
|
-
# Check that the frame-related threads have been killed.
|
|
3263
|
-
for _ in range(i):
|
|
3264
|
-
writer.wait_for_message(CMD_THREAD_KILL, expect_xml=False)
|
|
3265
|
-
|
|
3266
|
-
# Main thread stopped
|
|
3267
|
-
writer.wait_for_breakpoint_hit(REASON_STEP_OVER)
|
|
3268
|
-
|
|
3269
|
-
# At each time we have an additional custom frame (which is shown as if it
|
|
3270
|
-
# was a thread which is created and then suspended).
|
|
3271
|
-
for _ in range(i):
|
|
3272
|
-
writer.wait_for_message(CMD_THREAD_CREATE)
|
|
3273
|
-
writer.wait_for_breakpoint_hit(REASON_THREAD_SUSPEND)
|
|
3274
|
-
|
|
3275
|
-
writer.write_run_thread(hit.thread_id)
|
|
3276
|
-
|
|
3277
|
-
# Check that the frame-related threads have been killed.
|
|
3278
|
-
for _ in range(i):
|
|
3279
|
-
try:
|
|
3280
|
-
writer.wait_for_message(CMD_THREAD_KILL, expect_xml=False, timeout=1)
|
|
3281
|
-
except debugger_unittest.TimeoutError:
|
|
3282
|
-
# Flaky: sometimes the thread kill is not received because
|
|
3283
|
-
# the process exists before the message is sent.
|
|
3284
|
-
break
|
|
3285
|
-
|
|
3286
|
-
writer.finished_ok = True
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
@pytest.mark.skipif(not TEST_GEVENT, reason='Gevent not installed.')
|
|
3290
|
-
def test_gevent(case_setup):
|
|
3291
|
-
|
|
3292
|
-
def get_environ(writer):
|
|
3293
|
-
env = os.environ.copy()
|
|
3294
|
-
env['GEVENT_SUPPORT'] = 'True'
|
|
3295
|
-
return env
|
|
3296
|
-
|
|
3297
|
-
with case_setup.test_file('_debugger_case_gevent.py', get_environ=get_environ) as writer:
|
|
3298
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break here'))
|
|
3299
|
-
writer.write_make_initial_run()
|
|
3300
|
-
for _i in range(10):
|
|
3301
|
-
hit = writer.wait_for_breakpoint_hit(name='run')
|
|
3302
|
-
writer.write_run_thread(hit.thread_id)
|
|
3303
|
-
writer.finished_ok = True
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
@pytest.mark.skipif(not TEST_GEVENT, reason='Gevent not installed.')
|
|
3307
|
-
@pytest.mark.parametrize('show', [True, False])
|
|
3308
|
-
def test_gevent_show_paused_greenlets(case_setup, show):
|
|
3309
|
-
|
|
3310
|
-
def get_environ(writer):
|
|
3311
|
-
env = os.environ.copy()
|
|
3312
|
-
env['GEVENT_SUPPORT'] = 'True'
|
|
3313
|
-
if show:
|
|
3314
|
-
env['GEVENT_SHOW_PAUSED_GREENLETS'] = 'True'
|
|
3315
|
-
else:
|
|
3316
|
-
env['GEVENT_SHOW_PAUSED_GREENLETS'] = 'False'
|
|
3317
|
-
return env
|
|
3318
|
-
|
|
3319
|
-
with case_setup.test_file('_debugger_case_gevent_simple.py', get_environ=get_environ) as writer:
|
|
3320
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break here'))
|
|
3321
|
-
writer.write_make_initial_run()
|
|
3322
|
-
hit = writer.wait_for_breakpoint_hit(name='bar')
|
|
3323
|
-
writer.write_run_thread(hit.thread_id)
|
|
3324
|
-
|
|
3325
|
-
seq = writer.write_list_threads()
|
|
3326
|
-
msg = writer.wait_for_list_threads(seq)
|
|
3327
|
-
|
|
3328
|
-
if show:
|
|
3329
|
-
assert len(msg) > 1
|
|
3330
|
-
else:
|
|
3331
|
-
assert len(msg) == 1
|
|
3332
|
-
|
|
3333
|
-
writer.finished_ok = True
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
@pytest.mark.skipif(not TEST_GEVENT, reason='Gevent not installed.')
|
|
3337
|
-
def test_gevent_remote(case_setup_remote):
|
|
3338
|
-
|
|
3339
|
-
def get_environ(writer):
|
|
3340
|
-
env = os.environ.copy()
|
|
3341
|
-
env['GEVENT_SUPPORT'] = 'True'
|
|
3342
|
-
return env
|
|
3343
|
-
|
|
3344
|
-
with case_setup_remote.test_file('_debugger_case_gevent.py', get_environ=get_environ, append_command_line_args=['remote']) as writer:
|
|
3345
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break here'))
|
|
3346
|
-
writer.write_make_initial_run()
|
|
3347
|
-
for _i in range(10):
|
|
3348
|
-
hit = writer.wait_for_breakpoint_hit(name='run')
|
|
3349
|
-
writer.write_run_thread(hit.thread_id)
|
|
3350
|
-
writer.finished_ok = True
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
def test_return_value(case_setup):
|
|
3354
|
-
with case_setup.test_file('_debugger_case_return_value.py') as writer:
|
|
3355
|
-
break_line = writer.get_line_index_with_content('break here')
|
|
3356
|
-
writer.write_add_breakpoint(break_line)
|
|
3357
|
-
writer.write_show_return_vars()
|
|
3358
|
-
writer.write_make_initial_run()
|
|
3359
|
-
hit = writer.wait_for_breakpoint_hit(name='main', line=break_line)
|
|
3360
|
-
|
|
3361
|
-
writer.write_step_over(hit.thread_id)
|
|
3362
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STEP_OVER, name='main', line=break_line + 1)
|
|
3363
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
3364
|
-
writer.wait_for_vars([
|
|
3365
|
-
[
|
|
3366
|
-
'<var name="method1" type="int" qualifier="%s" value="int: 1" isRetVal="True"' % (builtin_qualifier,),
|
|
3367
|
-
'<var name="method1" type="int" value="int%253A 1" isRetVal="True"',
|
|
3368
|
-
],
|
|
3369
|
-
])
|
|
3370
|
-
|
|
3371
|
-
writer.write_step_over(hit.thread_id)
|
|
3372
|
-
hit = writer.wait_for_breakpoint_hit(REASON_STEP_OVER, name='main', line=break_line + 2)
|
|
3373
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
3374
|
-
writer.wait_for_vars([
|
|
3375
|
-
[
|
|
3376
|
-
'<var name="method2" type="int" qualifier="%s" value="int: 2" isRetVal="True"' % (builtin_qualifier,),
|
|
3377
|
-
'<var name="method2" type="int" value="int%253A 2" isRetVal="True"',
|
|
3378
|
-
],
|
|
3379
|
-
])
|
|
3380
|
-
|
|
3381
|
-
writer.write_run_thread(hit.thread_id)
|
|
3382
|
-
writer.finished_ok = True
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
def test_gettr_warning(case_setup):
|
|
3386
|
-
with case_setup.test_file('_debugger_case_warnings.py') as writer:
|
|
3387
|
-
break_line = writer.get_line_index_with_content('break here')
|
|
3388
|
-
writer.write_add_breakpoint(break_line)
|
|
3389
|
-
writer.write_make_initial_run()
|
|
3390
|
-
hit = writer.wait_for_breakpoint_hit(line=break_line)
|
|
3391
|
-
|
|
3392
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
3393
|
-
writer.wait_for_vars([
|
|
3394
|
-
[
|
|
3395
|
-
'<var name="obj'
|
|
3396
|
-
],
|
|
3397
|
-
])
|
|
3398
|
-
|
|
3399
|
-
writer.write_run_thread(hit.thread_id)
|
|
3400
|
-
writer.finished_ok = True
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Jython can only have one thread stopped at each time.')
|
|
3404
|
-
@pytest.mark.parametrize('check_single_notification', [True, False])
|
|
3405
|
-
def test_run_pause_all_threads_single_notification(case_setup, check_single_notification):
|
|
3406
|
-
from tests_python.debugger_unittest import TimeoutError
|
|
3407
|
-
with case_setup.test_file('_debugger_case_multiple_threads.py') as writer:
|
|
3408
|
-
# : :type writer: AbstractWriterThread
|
|
3409
|
-
writer.write_multi_threads_single_notification(True)
|
|
3410
|
-
writer.write_make_initial_run()
|
|
3411
|
-
|
|
3412
|
-
main_thread_id = writer.wait_for_new_thread()
|
|
3413
|
-
thread_id1 = writer.wait_for_new_thread()
|
|
3414
|
-
thread_id2 = writer.wait_for_new_thread()
|
|
3415
|
-
|
|
3416
|
-
# Ok, all threads created, let's wait for the main thread to get to the join.
|
|
3417
|
-
writer.wait_for_thread_join(main_thread_id)
|
|
3418
|
-
|
|
3419
|
-
writer.write_suspend_thread('*')
|
|
3420
|
-
|
|
3421
|
-
if check_single_notification:
|
|
3422
|
-
dct = writer.wait_for_json_message(CMD_THREAD_SUSPEND_SINGLE_NOTIFICATION)
|
|
3423
|
-
assert dct['thread_id'] in (thread_id1, thread_id2)
|
|
3424
|
-
assert dct['stop_reason'] == REASON_THREAD_SUSPEND
|
|
3425
|
-
else:
|
|
3426
|
-
# We should have a single thread suspended event for both threads.
|
|
3427
|
-
hit0 = writer.wait_for_breakpoint_hit(REASON_THREAD_SUSPEND)
|
|
3428
|
-
assert hit0.thread_id in (thread_id1, thread_id2)
|
|
3429
|
-
|
|
3430
|
-
hit1 = writer.wait_for_breakpoint_hit(REASON_THREAD_SUSPEND)
|
|
3431
|
-
assert hit1.thread_id in (thread_id1, thread_id2)
|
|
3432
|
-
|
|
3433
|
-
with pytest.raises(TimeoutError):
|
|
3434
|
-
# The main thread should not receive a hit as it's effectively deadlocked until other
|
|
3435
|
-
# threads finish.
|
|
3436
|
-
writer.wait_for_breakpoint_hit(REASON_THREAD_SUSPEND, timeout=1)
|
|
3437
|
-
|
|
3438
|
-
# Doing a step in in one thread, when paused should notify on both threads.
|
|
3439
|
-
writer.write_step_over(thread_id1)
|
|
3440
|
-
|
|
3441
|
-
if check_single_notification:
|
|
3442
|
-
dct = writer.wait_for_json_message(CMD_THREAD_RESUME_SINGLE_NOTIFICATION) # Note: prefer wait_for_single_notification_as_hit
|
|
3443
|
-
assert dct['thread_id'] == thread_id1
|
|
3444
|
-
|
|
3445
|
-
dct = writer.wait_for_json_message(CMD_THREAD_SUSPEND_SINGLE_NOTIFICATION) # Note: prefer wait_for_single_notification_as_hit
|
|
3446
|
-
assert dct['thread_id'] == thread_id1
|
|
3447
|
-
assert dct['stop_reason'] == REASON_STEP_OVER
|
|
3448
|
-
|
|
3449
|
-
hit = writer.get_current_stack_hit(thread_id1)
|
|
3450
|
-
|
|
3451
|
-
else:
|
|
3452
|
-
hit = writer.wait_for_breakpoint_hit(CMD_STEP_OVER)
|
|
3453
|
-
|
|
3454
|
-
writer.write_evaluate_expression('%s\t%s\t%s' % (hit.thread_id, hit.frame_id, 'LOCAL'), 'stop_loop()')
|
|
3455
|
-
writer.wait_for_evaluation('<var name="stop_loop()" type="str" qualifier="{0}" value="str: stopped_loop'.format(builtin_qualifier))
|
|
3456
|
-
|
|
3457
|
-
writer.write_run_thread('*')
|
|
3458
|
-
writer.finished_ok = True
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
def scenario_uncaught(writer):
|
|
3462
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
3463
|
-
writer.write_add_exception_breakpoint_with_policy('ValueError', '0', '1', '0')
|
|
3464
|
-
writer.write_run_thread(hit.thread_id)
|
|
3465
|
-
|
|
3466
|
-
hit = writer.wait_for_breakpoint_hit(REASON_UNCAUGHT_EXCEPTION)
|
|
3467
|
-
writer.write_run_thread(hit.thread_id)
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
def scenario_caught(writer):
|
|
3471
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
3472
|
-
writer.write_add_exception_breakpoint_with_policy('ValueError', '1', '0', '0')
|
|
3473
|
-
writer.write_run_thread(hit.thread_id)
|
|
3474
|
-
|
|
3475
|
-
for _ in range(2):
|
|
3476
|
-
hit = writer.wait_for_breakpoint_hit(REASON_CAUGHT_EXCEPTION)
|
|
3477
|
-
writer.write_run_thread(hit.thread_id)
|
|
3478
|
-
|
|
3479
|
-
# Note: the one in the top-level will be hit once as caught (but not another time
|
|
3480
|
-
# in postmortem mode).
|
|
3481
|
-
hit = writer.wait_for_breakpoint_hit(REASON_CAUGHT_EXCEPTION)
|
|
3482
|
-
writer.write_run_thread(hit.thread_id)
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
def scenario_caught_and_uncaught(writer):
|
|
3486
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
3487
|
-
writer.write_add_exception_breakpoint_with_policy('ValueError', '1', '1', '0')
|
|
3488
|
-
writer.write_run_thread(hit.thread_id)
|
|
3489
|
-
|
|
3490
|
-
for _ in range(2):
|
|
3491
|
-
hit = writer.wait_for_breakpoint_hit(REASON_CAUGHT_EXCEPTION)
|
|
3492
|
-
writer.write_run_thread(hit.thread_id)
|
|
3493
|
-
|
|
3494
|
-
# Note: the one in the top-level will be hit once as caught and another in postmortem mode.
|
|
3495
|
-
hit = writer.wait_for_breakpoint_hit(REASON_CAUGHT_EXCEPTION)
|
|
3496
|
-
writer.write_run_thread(hit.thread_id)
|
|
3497
|
-
|
|
3498
|
-
hit = writer.wait_for_breakpoint_hit(REASON_UNCAUGHT_EXCEPTION)
|
|
3499
|
-
writer.write_run_thread(hit.thread_id)
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
@pytest.mark.skipif(not IS_CPYTHON, reason='CPython only test.')
|
|
3503
|
-
@pytest.mark.parametrize(
|
|
3504
|
-
'check_scenario',
|
|
3505
|
-
[
|
|
3506
|
-
scenario_uncaught,
|
|
3507
|
-
scenario_caught,
|
|
3508
|
-
scenario_caught_and_uncaught,
|
|
3509
|
-
]
|
|
3510
|
-
)
|
|
3511
|
-
def test_top_level_exceptions_on_attach(case_setup_remote, check_scenario):
|
|
3512
|
-
|
|
3513
|
-
def check_test_suceeded_msg(writer, stdout, stderr):
|
|
3514
|
-
return 'TEST SUCEEDED' in ''.join(stderr)
|
|
3515
|
-
|
|
3516
|
-
def additional_output_checks(writer, stdout, stderr):
|
|
3517
|
-
# Don't call super as we have an expected exception
|
|
3518
|
-
assert 'ValueError: TEST SUCEEDED' in stderr
|
|
3519
|
-
|
|
3520
|
-
with case_setup_remote.test_file(
|
|
3521
|
-
'_debugger_case_remote_unhandled_exceptions2.py',
|
|
3522
|
-
additional_output_checks=additional_output_checks,
|
|
3523
|
-
check_test_suceeded_msg=check_test_suceeded_msg,
|
|
3524
|
-
EXPECTED_RETURNCODE=1) as writer:
|
|
3525
|
-
|
|
3526
|
-
writer.log.append('making initial run')
|
|
3527
|
-
writer.write_make_initial_run()
|
|
3528
|
-
|
|
3529
|
-
check_scenario(writer)
|
|
3530
|
-
|
|
3531
|
-
writer.log.append('finished ok')
|
|
3532
|
-
writer.finished_ok = True
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
@pytest.mark.parametrize('filename, break_at_lines', [
|
|
3536
|
-
('_debugger_case_tracing.py', {2: 'frame_eval'}),
|
|
3537
|
-
|
|
3538
|
-
('_debugger_case_tracing.py', {3: 'frame_eval'}),
|
|
3539
|
-
('_debugger_case_tracing.py', {4: 'frame_eval'}),
|
|
3540
|
-
('_debugger_case_tracing.py', {2: 'frame_eval', 4: 'trace'}),
|
|
3541
|
-
|
|
3542
|
-
('_debugger_case_tracing.py', {8: 'frame_eval'}),
|
|
3543
|
-
('_debugger_case_tracing.py', {9: 'frame_eval'}),
|
|
3544
|
-
('_debugger_case_tracing.py', {10: 'frame_eval'}),
|
|
3545
|
-
|
|
3546
|
-
# Note: second frame eval hit is actually a trace because after we
|
|
3547
|
-
# hit the first frame eval we don't actually stop tracing a given
|
|
3548
|
-
# frame (known limitation to be fixed in the future).
|
|
3549
|
-
# -- needs a better test
|
|
3550
|
-
('_debugger_case_tracing.py', {8: 'frame_eval', 10: 'trace'}),
|
|
3551
|
-
])
|
|
3552
|
-
def test_frame_eval_limitations(case_setup, filename, break_at_lines):
|
|
3553
|
-
'''
|
|
3554
|
-
Test with limitations to be addressed in the future.
|
|
3555
|
-
'''
|
|
3556
|
-
with case_setup.test_file(filename) as writer:
|
|
3557
|
-
for break_at_line in break_at_lines:
|
|
3558
|
-
writer.write_add_breakpoint(break_at_line)
|
|
3559
|
-
|
|
3560
|
-
writer.log.append('making initial run')
|
|
3561
|
-
writer.write_make_initial_run()
|
|
3562
|
-
|
|
3563
|
-
for break_at_line, break_mode in break_at_lines.items():
|
|
3564
|
-
writer.log.append('waiting for breakpoint hit')
|
|
3565
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
3566
|
-
thread_id = hit.thread_id
|
|
3567
|
-
|
|
3568
|
-
if (IS_PY36_OR_GREATER and TEST_CYTHON) and not TODO_PY311:
|
|
3569
|
-
assert hit.suspend_type == break_mode
|
|
3570
|
-
else:
|
|
3571
|
-
# Before 3.6 frame eval is not available.
|
|
3572
|
-
assert hit.suspend_type == 'trace'
|
|
3573
|
-
|
|
3574
|
-
writer.log.append('run thread')
|
|
3575
|
-
writer.write_run_thread(thread_id)
|
|
3576
|
-
|
|
3577
|
-
writer.finished_ok = True
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
def test_step_return_my_code(case_setup):
|
|
3581
|
-
with case_setup.test_file('my_code/my_code.py') as writer:
|
|
3582
|
-
writer.write_set_project_roots([debugger_unittest._get_debugger_test_file('my_code')])
|
|
3583
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break here'))
|
|
3584
|
-
writer.write_make_initial_run()
|
|
3585
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
3586
|
-
|
|
3587
|
-
writer.write_step_in_my_code(hit.thread_id)
|
|
3588
|
-
hit = writer.wait_for_breakpoint_hit(reason=REASON_STEP_INTO_MY_CODE)
|
|
3589
|
-
assert hit.name == 'callback1'
|
|
3590
|
-
|
|
3591
|
-
writer.write_step_in_my_code(hit.thread_id)
|
|
3592
|
-
hit = writer.wait_for_breakpoint_hit(reason=REASON_STEP_INTO_MY_CODE)
|
|
3593
|
-
assert hit.name == 'callback2'
|
|
3594
|
-
|
|
3595
|
-
writer.write_step_return_my_code(hit.thread_id)
|
|
3596
|
-
hit = writer.wait_for_breakpoint_hit(reason=REASON_STEP_RETURN_MY_CODE)
|
|
3597
|
-
assert hit.name == 'callback1'
|
|
3598
|
-
|
|
3599
|
-
writer.write_step_return_my_code(hit.thread_id)
|
|
3600
|
-
hit = writer.wait_for_breakpoint_hit(reason=REASON_STEP_RETURN_MY_CODE)
|
|
3601
|
-
assert hit.name == '<module>'
|
|
3602
|
-
|
|
3603
|
-
writer.write_step_return_my_code(hit.thread_id)
|
|
3604
|
-
writer.finished_ok = True
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
@pytest.mark.skipif(TODO_PY311, reason='Needs bytecode support in Python 3.11')
|
|
3608
|
-
def test_smart_step_into_case1(case_setup):
|
|
3609
|
-
with case_setup.test_file('_debugger_case_smart_step_into.py') as writer:
|
|
3610
|
-
line = writer.get_line_index_with_content('break here')
|
|
3611
|
-
writer.write_add_breakpoint(line)
|
|
3612
|
-
writer.write_make_initial_run()
|
|
3613
|
-
hit = writer.wait_for_breakpoint_hit(line=line)
|
|
3614
|
-
|
|
3615
|
-
found = writer.get_step_into_variants(hit.thread_id, hit.frame_id, line, line)
|
|
3616
|
-
|
|
3617
|
-
# Remove the offset/childOffset to compare (as it changes for each python version)
|
|
3618
|
-
assert [x[:-2] for x in found] == [
|
|
3619
|
-
('bar', 'false', '14', '1'), ('foo', 'false', '14', '1'), ('call_outer', 'false', '14', '1')]
|
|
3620
|
-
|
|
3621
|
-
# Note: this is just using the name, not really taking using the context.
|
|
3622
|
-
writer.write_smart_step_into(hit.thread_id, line, 'foo')
|
|
3623
|
-
hit = writer.wait_for_breakpoint_hit(reason=CMD_SMART_STEP_INTO)
|
|
3624
|
-
assert hit.line == writer.get_line_index_with_content('on foo mark')
|
|
3625
|
-
|
|
3626
|
-
writer.write_run_thread(hit.thread_id)
|
|
3627
|
-
writer.finished_ok = True
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
@pytest.mark.skipif(TODO_PY311, reason='Needs bytecode support in Python 3.11')
|
|
3631
|
-
def test_smart_step_into_case2(case_setup):
|
|
3632
|
-
with case_setup.test_file('_debugger_case_smart_step_into2.py') as writer:
|
|
3633
|
-
line = writer.get_line_index_with_content('break here')
|
|
3634
|
-
writer.write_add_breakpoint(line)
|
|
3635
|
-
writer.write_make_initial_run()
|
|
3636
|
-
hit = writer.wait_for_breakpoint_hit(line=line)
|
|
3637
|
-
|
|
3638
|
-
found = writer.get_step_into_variants(hit.thread_id, hit.frame_id, line, line)
|
|
3639
|
-
|
|
3640
|
-
# Note: we have multiple 'foo' calls, so, we have to differentiate to
|
|
3641
|
-
# know in which one we want to stop.
|
|
3642
|
-
OFFSET_POS = 4
|
|
3643
|
-
writer.write_smart_step_into(hit.thread_id, 'offset=' + found[2][OFFSET_POS], 'foo')
|
|
3644
|
-
hit = writer.wait_for_breakpoint_hit(reason=CMD_SMART_STEP_INTO)
|
|
3645
|
-
assert hit.line == writer.get_line_index_with_content('on foo mark')
|
|
3646
|
-
|
|
3647
|
-
writer.write_get_frame(hit.thread_id, hit.frame_id)
|
|
3648
|
-
writer.wait_for_var([
|
|
3649
|
-
(
|
|
3650
|
-
'<var name="arg" type="int" qualifier="__builtin__" value="int: 3"',
|
|
3651
|
-
'<var name="arg" type="int" qualifier="builtins" value="int: 3"',
|
|
3652
|
-
)
|
|
3653
|
-
])
|
|
3654
|
-
|
|
3655
|
-
writer.write_run_thread(hit.thread_id)
|
|
3656
|
-
writer.finished_ok = True
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
@pytest.mark.skipif(TODO_PY311, reason='Needs bytecode support in Python 3.11')
|
|
3660
|
-
def test_smart_step_into_case3(case_setup):
|
|
3661
|
-
with case_setup.test_file('_debugger_case_smart_step_into3.py') as writer:
|
|
3662
|
-
line = writer.get_line_index_with_content('break here')
|
|
3663
|
-
writer.write_add_breakpoint(line)
|
|
3664
|
-
writer.write_make_initial_run()
|
|
3665
|
-
hit = writer.wait_for_breakpoint_hit(line=line)
|
|
3666
|
-
|
|
3667
|
-
found = writer.get_step_into_variants(hit.thread_id, hit.frame_id, 0, 9999)
|
|
3668
|
-
|
|
3669
|
-
# Note: we have multiple 'foo' calls, so, we have to differentiate to
|
|
3670
|
-
# know in which one we want to stop.
|
|
3671
|
-
NAME_POS = 0
|
|
3672
|
-
OFFSET_POS = 4
|
|
3673
|
-
CHILD_OFFSET_POS = 5
|
|
3674
|
-
|
|
3675
|
-
f = [x for x in found if x[NAME_POS] == 'foo']
|
|
3676
|
-
assert len(f) == 1
|
|
3677
|
-
|
|
3678
|
-
writer.write_smart_step_into(hit.thread_id, 'offset=' + f[0][OFFSET_POS] + ';' + f[0][CHILD_OFFSET_POS], 'foo')
|
|
3679
|
-
hit = writer.wait_for_breakpoint_hit(reason=CMD_SMART_STEP_INTO)
|
|
3680
|
-
assert hit.line == writer.get_line_index_with_content('on foo mark')
|
|
3681
|
-
|
|
3682
|
-
writer.write_run_thread(hit.thread_id)
|
|
3683
|
-
writer.finished_ok = True
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
def test_step_over_my_code(case_setup):
|
|
3687
|
-
with case_setup.test_file('my_code/my_code.py') as writer:
|
|
3688
|
-
writer.write_set_project_roots([debugger_unittest._get_debugger_test_file('my_code')])
|
|
3689
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break here'))
|
|
3690
|
-
writer.write_make_initial_run()
|
|
3691
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
3692
|
-
|
|
3693
|
-
writer.write_step_in_my_code(hit.thread_id)
|
|
3694
|
-
hit = writer.wait_for_breakpoint_hit(reason=REASON_STEP_INTO_MY_CODE)
|
|
3695
|
-
assert hit.name == 'callback1'
|
|
3696
|
-
|
|
3697
|
-
writer.write_step_in_my_code(hit.thread_id)
|
|
3698
|
-
hit = writer.wait_for_breakpoint_hit(reason=REASON_STEP_INTO_MY_CODE)
|
|
3699
|
-
assert hit.name == 'callback2'
|
|
3700
|
-
|
|
3701
|
-
writer.write_step_over_my_code(hit.thread_id)
|
|
3702
|
-
hit = writer.wait_for_breakpoint_hit(reason=REASON_STEP_OVER_MY_CODE) # Note: goes from step over to step into
|
|
3703
|
-
assert hit.name == 'callback1'
|
|
3704
|
-
|
|
3705
|
-
writer.write_step_over_my_code(hit.thread_id)
|
|
3706
|
-
hit = writer.wait_for_breakpoint_hit(reason=REASON_STEP_OVER_MY_CODE) # Note: goes from step over to step into
|
|
3707
|
-
assert hit.name == '<module>'
|
|
3708
|
-
|
|
3709
|
-
writer.write_step_over_my_code(hit.thread_id)
|
|
3710
|
-
hit = writer.wait_for_breakpoint_hit(reason=REASON_STEP_OVER_MY_CODE)
|
|
3711
|
-
assert hit.name == '<module>'
|
|
3712
|
-
|
|
3713
|
-
writer.write_step_over_my_code(hit.thread_id)
|
|
3714
|
-
writer.finished_ok = True
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
@pytest.fixture(
|
|
3718
|
-
params=[
|
|
3719
|
-
'step_over',
|
|
3720
|
-
'step_return',
|
|
3721
|
-
'step_in',
|
|
3722
|
-
]
|
|
3723
|
-
)
|
|
3724
|
-
def step_method(request):
|
|
3725
|
-
return request.param
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
def test_sysexit_on_filtered_file(case_setup):
|
|
3729
|
-
|
|
3730
|
-
def get_environ(writer):
|
|
3731
|
-
env = os.environ.copy()
|
|
3732
|
-
env.update({'PYDEVD_FILTERS': json.dumps({'**/_debugger_case_sysexit.py': True})})
|
|
3733
|
-
return env
|
|
3734
|
-
|
|
3735
|
-
with case_setup.test_file('_debugger_case_sysexit.py', get_environ=get_environ, EXPECTED_RETURNCODE=1) as writer:
|
|
3736
|
-
writer.write_add_exception_breakpoint_with_policy(
|
|
3737
|
-
'SystemExit',
|
|
3738
|
-
notify_on_handled_exceptions=1, # Notify multiple times
|
|
3739
|
-
notify_on_unhandled_exceptions=1,
|
|
3740
|
-
ignore_libraries=0
|
|
3741
|
-
)
|
|
3742
|
-
|
|
3743
|
-
writer.write_make_initial_run()
|
|
3744
|
-
writer.finished_ok = True
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
@pytest.mark.parametrize("scenario", [
|
|
3748
|
-
'handled_once',
|
|
3749
|
-
'handled_multiple',
|
|
3750
|
-
'unhandled',
|
|
3751
|
-
])
|
|
3752
|
-
def test_exception_not_on_filtered_file(case_setup, scenario):
|
|
3753
|
-
|
|
3754
|
-
def get_environ(writer):
|
|
3755
|
-
env = os.environ.copy()
|
|
3756
|
-
env.update({'PYDEVD_FILTERS': json.dumps({'**/other.py': True})})
|
|
3757
|
-
return env
|
|
3758
|
-
|
|
3759
|
-
def check_test_suceeded_msg(writer, stdout, stderr):
|
|
3760
|
-
return 'TEST SUCEEDED' in ''.join(stderr)
|
|
3761
|
-
|
|
3762
|
-
def additional_output_checks(writer, stdout, stderr):
|
|
3763
|
-
if 'raise RuntimeError' not in stderr:
|
|
3764
|
-
raise AssertionError('Expected test to have an unhandled exception.\nstdout:\n%s\n\nstderr:\n%s' % (
|
|
3765
|
-
stdout, stderr))
|
|
3766
|
-
|
|
3767
|
-
with case_setup.test_file(
|
|
3768
|
-
'my_code/my_code_exception.py',
|
|
3769
|
-
get_environ=get_environ,
|
|
3770
|
-
EXPECTED_RETURNCODE='any',
|
|
3771
|
-
check_test_suceeded_msg=check_test_suceeded_msg,
|
|
3772
|
-
additional_output_checks=additional_output_checks,
|
|
3773
|
-
) as writer:
|
|
3774
|
-
|
|
3775
|
-
if scenario == 'handled_once':
|
|
3776
|
-
writer.write_add_exception_breakpoint_with_policy(
|
|
3777
|
-
'RuntimeError',
|
|
3778
|
-
notify_on_handled_exceptions=2, # Notify only once
|
|
3779
|
-
notify_on_unhandled_exceptions=0,
|
|
3780
|
-
ignore_libraries=0
|
|
3781
|
-
)
|
|
3782
|
-
elif scenario == 'handled_multiple':
|
|
3783
|
-
writer.write_add_exception_breakpoint_with_policy(
|
|
3784
|
-
'RuntimeError',
|
|
3785
|
-
notify_on_handled_exceptions=1, # Notify multiple times
|
|
3786
|
-
notify_on_unhandled_exceptions=0,
|
|
3787
|
-
ignore_libraries=0
|
|
3788
|
-
)
|
|
3789
|
-
elif scenario == 'unhandled':
|
|
3790
|
-
writer.write_add_exception_breakpoint_with_policy(
|
|
3791
|
-
'RuntimeError',
|
|
3792
|
-
notify_on_handled_exceptions=0,
|
|
3793
|
-
notify_on_unhandled_exceptions=1,
|
|
3794
|
-
ignore_libraries=0
|
|
3795
|
-
)
|
|
3796
|
-
|
|
3797
|
-
writer.write_make_initial_run()
|
|
3798
|
-
for _i in range(3 if scenario == 'handled_multiple' else 1):
|
|
3799
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
3800
|
-
REASON_UNCAUGHT_EXCEPTION if scenario == 'unhandled' else REASON_CAUGHT_EXCEPTION)
|
|
3801
|
-
writer.write_run_thread(hit.thread_id)
|
|
3802
|
-
writer.finished_ok = True
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
def test_exception_on_filtered_file(case_setup):
|
|
3806
|
-
|
|
3807
|
-
def get_environ(writer):
|
|
3808
|
-
env = os.environ.copy()
|
|
3809
|
-
env.update({'PYDEVD_FILTERS': json.dumps({'**/other.py': True})})
|
|
3810
|
-
return env
|
|
3811
|
-
|
|
3812
|
-
def check_test_suceeded_msg(writer, stdout, stderr):
|
|
3813
|
-
return 'TEST SUCEEDED' in ''.join(stderr)
|
|
3814
|
-
|
|
3815
|
-
def additional_output_checks(writer, stdout, stderr):
|
|
3816
|
-
if 'raise RuntimeError' not in stderr:
|
|
3817
|
-
raise AssertionError('Expected test to have an unhandled exception.\nstdout:\n%s\n\nstderr:\n%s' % (
|
|
3818
|
-
stdout, stderr))
|
|
3819
|
-
|
|
3820
|
-
with case_setup.test_file(
|
|
3821
|
-
'my_code/my_code_exception_on_other.py',
|
|
3822
|
-
get_environ=get_environ,
|
|
3823
|
-
EXPECTED_RETURNCODE='any',
|
|
3824
|
-
check_test_suceeded_msg=check_test_suceeded_msg,
|
|
3825
|
-
additional_output_checks=additional_output_checks,
|
|
3826
|
-
) as writer:
|
|
3827
|
-
writer.write_add_exception_breakpoint_with_policy(
|
|
3828
|
-
'RuntimeError',
|
|
3829
|
-
notify_on_handled_exceptions=2, # Notify only once
|
|
3830
|
-
notify_on_unhandled_exceptions=1,
|
|
3831
|
-
ignore_libraries=0
|
|
3832
|
-
)
|
|
3833
|
-
|
|
3834
|
-
writer.write_make_initial_run()
|
|
3835
|
-
|
|
3836
|
-
# Note: the unhandled exception was initially raised in a file which is filtered out, but we
|
|
3837
|
-
# should be able to see the frames which are part of the project.
|
|
3838
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
3839
|
-
REASON_UNCAUGHT_EXCEPTION,
|
|
3840
|
-
file='my_code_exception_on_other.py',
|
|
3841
|
-
line=writer.get_line_index_with_content('other.raise_exception()')
|
|
3842
|
-
)
|
|
3843
|
-
writer.write_run_thread(hit.thread_id)
|
|
3844
|
-
|
|
3845
|
-
writer.finished_ok = True
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
@pytest.mark.parametrize("environ", [
|
|
3849
|
-
{'PYDEVD_FILTER_LIBRARIES': '1'}, # Global setting for step over
|
|
3850
|
-
{'PYDEVD_FILTERS': json.dumps({'**/other.py': True})}, # specify as json
|
|
3851
|
-
{'PYDEVD_FILTERS': '**/other.py'}, # specify ';' separated list
|
|
3852
|
-
])
|
|
3853
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Flaky on Jython.')
|
|
3854
|
-
def test_step_over_my_code_global_settings(case_setup, environ, step_method):
|
|
3855
|
-
|
|
3856
|
-
def get_environ(writer):
|
|
3857
|
-
env = os.environ.copy()
|
|
3858
|
-
env.update(environ)
|
|
3859
|
-
return env
|
|
3860
|
-
|
|
3861
|
-
def do_step():
|
|
3862
|
-
if step_method == 'step_over':
|
|
3863
|
-
writer.write_step_over(hit.thread_id)
|
|
3864
|
-
return REASON_STEP_OVER # Note: goes from step over to step into
|
|
3865
|
-
elif step_method == 'step_return':
|
|
3866
|
-
writer.write_step_return(hit.thread_id)
|
|
3867
|
-
return REASON_STEP_RETURN
|
|
3868
|
-
else:
|
|
3869
|
-
assert step_method == 'step_in'
|
|
3870
|
-
writer.write_step_in(hit.thread_id)
|
|
3871
|
-
return REASON_STEP_INTO
|
|
3872
|
-
|
|
3873
|
-
with case_setup.test_file('my_code/my_code.py', get_environ=get_environ) as writer:
|
|
3874
|
-
writer.write_set_project_roots([debugger_unittest._get_debugger_test_file('my_code')])
|
|
3875
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break here'))
|
|
3876
|
-
writer.write_make_initial_run()
|
|
3877
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
3878
|
-
|
|
3879
|
-
writer.write_step_in(hit.thread_id)
|
|
3880
|
-
hit = writer.wait_for_breakpoint_hit(reason=REASON_STEP_INTO)
|
|
3881
|
-
assert hit.name == 'callback1'
|
|
3882
|
-
|
|
3883
|
-
writer.write_step_in(hit.thread_id)
|
|
3884
|
-
hit = writer.wait_for_breakpoint_hit(reason=REASON_STEP_INTO)
|
|
3885
|
-
assert hit.name == 'callback2'
|
|
3886
|
-
|
|
3887
|
-
stop_reason = do_step()
|
|
3888
|
-
hit = writer.wait_for_breakpoint_hit(reason=stop_reason)
|
|
3889
|
-
assert hit.name == 'callback1'
|
|
3890
|
-
|
|
3891
|
-
stop_reason = do_step()
|
|
3892
|
-
hit = writer.wait_for_breakpoint_hit(reason=stop_reason)
|
|
3893
|
-
assert hit.name == '<module>'
|
|
3894
|
-
|
|
3895
|
-
if IS_JYTHON:
|
|
3896
|
-
# Jython may get to exit functions, so, just resume the thread.
|
|
3897
|
-
writer.write_run_thread(hit.thread_id)
|
|
3898
|
-
|
|
3899
|
-
else:
|
|
3900
|
-
stop_reason = do_step()
|
|
3901
|
-
|
|
3902
|
-
if step_method != 'step_return':
|
|
3903
|
-
stop_reason = do_step()
|
|
3904
|
-
if step_method == 'step_over':
|
|
3905
|
-
stop_reason = REASON_STEP_OVER
|
|
3906
|
-
|
|
3907
|
-
hit = writer.wait_for_breakpoint_hit(reason=stop_reason)
|
|
3908
|
-
assert hit.name == '<module>'
|
|
3909
|
-
|
|
3910
|
-
writer.write_step_over(hit.thread_id)
|
|
3911
|
-
|
|
3912
|
-
writer.finished_ok = True
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
def test_step_over_my_code_global_setting_and_explicit_include(case_setup):
|
|
3916
|
-
|
|
3917
|
-
def get_environ(writer):
|
|
3918
|
-
env = os.environ.copy()
|
|
3919
|
-
env.update({
|
|
3920
|
-
'PYDEVD_FILTER_LIBRARIES': '1', # Global setting for in project or not
|
|
3921
|
-
# specify as json (force include).
|
|
3922
|
-
'PYDEVD_FILTERS': json.dumps({'**/other.py': False})
|
|
3923
|
-
})
|
|
3924
|
-
return env
|
|
3925
|
-
|
|
3926
|
-
with case_setup.test_file('my_code/my_code.py', get_environ=get_environ) as writer:
|
|
3927
|
-
writer.write_set_project_roots([debugger_unittest._get_debugger_test_file('my_code')])
|
|
3928
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break here'))
|
|
3929
|
-
writer.write_make_initial_run()
|
|
3930
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
3931
|
-
|
|
3932
|
-
writer.write_step_in(hit.thread_id)
|
|
3933
|
-
hit = writer.wait_for_breakpoint_hit(reason=REASON_STEP_INTO)
|
|
3934
|
-
|
|
3935
|
-
# Although we filtered out non-project files, other.py is explicitly included.
|
|
3936
|
-
assert hit.name == 'call_me_back1'
|
|
3937
|
-
|
|
3938
|
-
writer.write_run_thread(hit.thread_id)
|
|
3939
|
-
writer.finished_ok = True
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
def test_access_token(case_setup):
|
|
3943
|
-
|
|
3944
|
-
def update_command_line_args(self, args):
|
|
3945
|
-
i = args.index('--client')
|
|
3946
|
-
assert i > 0
|
|
3947
|
-
args.insert(i, '--access-token')
|
|
3948
|
-
args.insert(i + 1, 'bar123')
|
|
3949
|
-
args.insert(i, '--client-access-token')
|
|
3950
|
-
args.insert(i + 1, 'foo234')
|
|
3951
|
-
return args
|
|
3952
|
-
|
|
3953
|
-
with case_setup.test_file('_debugger_case_print.py', update_command_line_args=update_command_line_args) as writer:
|
|
3954
|
-
writer.write_add_breakpoint(1, 'None') # I.e.: should not work (not authenticated).
|
|
3955
|
-
|
|
3956
|
-
writer.wait_for_message(lambda msg:'Client not authenticated.' in msg, expect_xml=False)
|
|
3957
|
-
|
|
3958
|
-
writer.write_authenticate(access_token='bar123', client_access_token='foo234')
|
|
3959
|
-
|
|
3960
|
-
writer.write_version()
|
|
3961
|
-
|
|
3962
|
-
writer.write_make_initial_run()
|
|
3963
|
-
|
|
3964
|
-
writer.finished_ok = True
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
def test_namedtuple(case_setup):
|
|
3968
|
-
'''
|
|
3969
|
-
Check that we don't step into <string> in the namedtuple constructor.
|
|
3970
|
-
'''
|
|
3971
|
-
with case_setup.test_file('_debugger_case_namedtuple.py') as writer:
|
|
3972
|
-
line = writer.get_line_index_with_content('break here')
|
|
3973
|
-
writer.write_add_breakpoint(line)
|
|
3974
|
-
writer.write_make_initial_run()
|
|
3975
|
-
|
|
3976
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
3977
|
-
|
|
3978
|
-
expected_line = line
|
|
3979
|
-
|
|
3980
|
-
for _ in range(2):
|
|
3981
|
-
expected_line += 1
|
|
3982
|
-
writer.write_step_in(hit.thread_id)
|
|
3983
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
3984
|
-
reason=REASON_STEP_INTO, file='_debugger_case_namedtuple.py', line=expected_line)
|
|
3985
|
-
|
|
3986
|
-
writer.write_run_thread(hit.thread_id)
|
|
3987
|
-
writer.finished_ok = True
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
def test_matplotlib_activation(case_setup):
|
|
3991
|
-
try:
|
|
3992
|
-
import matplotlib
|
|
3993
|
-
except ImportError:
|
|
3994
|
-
return
|
|
3995
|
-
|
|
3996
|
-
def get_environ(writer):
|
|
3997
|
-
env = os.environ.copy()
|
|
3998
|
-
env.update({
|
|
3999
|
-
'IPYTHONENABLE': 'True',
|
|
4000
|
-
})
|
|
4001
|
-
return env
|
|
4002
|
-
|
|
4003
|
-
with case_setup.test_file('_debugger_case_matplotlib.py', get_environ=get_environ) as writer:
|
|
4004
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break here'))
|
|
4005
|
-
writer.write_make_initial_run()
|
|
4006
|
-
for _ in range(3):
|
|
4007
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
4008
|
-
writer.write_run_thread(hit.thread_id)
|
|
4009
|
-
|
|
4010
|
-
writer.finished_ok = True
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
_GENERATOR_FILES = [
|
|
4014
|
-
'_debugger_case_generator3.py',
|
|
4015
|
-
'_debugger_case_generator.py',
|
|
4016
|
-
'_debugger_case_generator2.py',
|
|
4017
|
-
]
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
@pytest.mark.parametrize('target_filename', _GENERATOR_FILES)
|
|
4021
|
-
@pytest.mark.skipif(IS_JYTHON, reason='We do not detect generator returns on Jython.')
|
|
4022
|
-
def test_generator_step_over_basic(case_setup, target_filename):
|
|
4023
|
-
with case_setup.test_file(target_filename) as writer:
|
|
4024
|
-
line = writer.get_line_index_with_content('break here')
|
|
4025
|
-
writer.write_add_breakpoint(line)
|
|
4026
|
-
writer.write_make_initial_run()
|
|
4027
|
-
|
|
4028
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
4029
|
-
|
|
4030
|
-
# Note: not using for so that we know which step failed in the ci if it fails.
|
|
4031
|
-
writer.write_step_over(hit.thread_id)
|
|
4032
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
4033
|
-
reason=REASON_STEP_OVER,
|
|
4034
|
-
file=target_filename,
|
|
4035
|
-
line=writer.get_line_index_with_content('step 1')
|
|
4036
|
-
)
|
|
4037
|
-
|
|
4038
|
-
writer.write_step_over(hit.thread_id)
|
|
4039
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
4040
|
-
reason=REASON_STEP_OVER,
|
|
4041
|
-
file=target_filename,
|
|
4042
|
-
line=writer.get_line_index_with_content('step 2')
|
|
4043
|
-
)
|
|
4044
|
-
|
|
4045
|
-
if IS_PY38_OR_GREATER and target_filename == '_debugger_case_generator2.py':
|
|
4046
|
-
# On py 3.8 it goes back to the return line.
|
|
4047
|
-
writer.write_step_over(hit.thread_id)
|
|
4048
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
4049
|
-
reason=REASON_STEP_OVER,
|
|
4050
|
-
file=target_filename,
|
|
4051
|
-
line=writer.get_line_index_with_content('return \\')
|
|
4052
|
-
)
|
|
4053
|
-
|
|
4054
|
-
writer.write_step_over(hit.thread_id)
|
|
4055
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
4056
|
-
reason=REASON_STEP_OVER,
|
|
4057
|
-
file=target_filename,
|
|
4058
|
-
line=writer.get_line_index_with_content('step 3')
|
|
4059
|
-
)
|
|
4060
|
-
|
|
4061
|
-
writer.write_run_thread(hit.thread_id)
|
|
4062
|
-
writer.finished_ok = True
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
@pytest.mark.parametrize('target_filename', _GENERATOR_FILES)
|
|
4066
|
-
@pytest.mark.skipif(IS_JYTHON, reason='We do not detect generator returns on Jython.')
|
|
4067
|
-
def test_generator_step_return(case_setup, target_filename):
|
|
4068
|
-
with case_setup.test_file(target_filename) as writer:
|
|
4069
|
-
line = writer.get_line_index_with_content('break here')
|
|
4070
|
-
writer.write_add_breakpoint(line)
|
|
4071
|
-
writer.write_make_initial_run()
|
|
4072
|
-
|
|
4073
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
4074
|
-
|
|
4075
|
-
# Note: not using for so that we know which step failed in the ci if it fails.
|
|
4076
|
-
writer.write_step_return(hit.thread_id)
|
|
4077
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
4078
|
-
reason=REASON_STEP_RETURN,
|
|
4079
|
-
file=target_filename,
|
|
4080
|
-
line=writer.get_line_index_with_content('generator return')
|
|
4081
|
-
)
|
|
4082
|
-
|
|
4083
|
-
writer.write_step_over(hit.thread_id)
|
|
4084
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
4085
|
-
reason=REASON_STEP_OVER,
|
|
4086
|
-
file=target_filename,
|
|
4087
|
-
line=writer.get_line_index_with_content('step 3')
|
|
4088
|
-
)
|
|
4089
|
-
|
|
4090
|
-
writer.write_run_thread(hit.thread_id)
|
|
4091
|
-
writer.finished_ok = True
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
@pytest.mark.skipif(not IS_PY36_OR_GREATER, reason='Only CPython 3.6 onwards')
|
|
4095
|
-
def test_stepin_not_my_code_coroutine(case_setup):
|
|
4096
|
-
|
|
4097
|
-
def get_environ(writer):
|
|
4098
|
-
environ = {'PYDEVD_FILTERS': '{"**/not_my_coroutine.py": true}'}
|
|
4099
|
-
env = os.environ.copy()
|
|
4100
|
-
env.update(environ)
|
|
4101
|
-
return env
|
|
4102
|
-
|
|
4103
|
-
with case_setup.test_file('my_code/my_code_coroutine.py', get_environ=get_environ) as writer:
|
|
4104
|
-
writer.write_set_project_roots([debugger_unittest._get_debugger_test_file('my_code')])
|
|
4105
|
-
writer.write_add_breakpoint(writer.get_line_index_with_content('break here'))
|
|
4106
|
-
writer.write_make_initial_run()
|
|
4107
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
4108
|
-
|
|
4109
|
-
writer.write_step_in(hit.thread_id)
|
|
4110
|
-
hit = writer.wait_for_breakpoint_hit(reason=REASON_STEP_INTO)
|
|
4111
|
-
assert hit.name == 'main'
|
|
4112
|
-
|
|
4113
|
-
writer.write_run_thread(hit.thread_id)
|
|
4114
|
-
writer.finished_ok = True
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
@pytest.mark.skipif(IS_JYTHON, reason='Flaky on Jython')
|
|
4118
|
-
def test_generator_step_in(case_setup):
|
|
4119
|
-
with case_setup.test_file('_debugger_case_generator_step_in.py') as writer:
|
|
4120
|
-
line = writer.get_line_index_with_content('stop 1')
|
|
4121
|
-
writer.write_add_breakpoint(line)
|
|
4122
|
-
writer.write_make_initial_run()
|
|
4123
|
-
|
|
4124
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
4125
|
-
|
|
4126
|
-
for i in range(2, 5):
|
|
4127
|
-
writer.write_step_in(hit.thread_id)
|
|
4128
|
-
kwargs = {}
|
|
4129
|
-
if not IS_JYTHON:
|
|
4130
|
-
kwargs['line'] = writer.get_line_index_with_content('stop %s' % (i,))
|
|
4131
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
4132
|
-
reason=REASON_STEP_INTO,
|
|
4133
|
-
file='_debugger_case_generator_step_in.py',
|
|
4134
|
-
**kwargs
|
|
4135
|
-
)
|
|
4136
|
-
|
|
4137
|
-
writer.write_run_thread(hit.thread_id)
|
|
4138
|
-
writer.finished_ok = True
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
@pytest.mark.parametrize(
|
|
4142
|
-
'target_filename',
|
|
4143
|
-
[
|
|
4144
|
-
'_debugger_case_asyncio.py',
|
|
4145
|
-
'_debugger_case_trio.py',
|
|
4146
|
-
]
|
|
4147
|
-
)
|
|
4148
|
-
@pytest.mark.skipif(not IS_CPYTHON or not IS_PY36_OR_GREATER, reason='Only CPython 3.6 onwards')
|
|
4149
|
-
def test_asyncio_step_over_basic(case_setup, target_filename):
|
|
4150
|
-
with case_setup.test_file(target_filename) as writer:
|
|
4151
|
-
line = writer.get_line_index_with_content('break main')
|
|
4152
|
-
writer.write_add_breakpoint(line)
|
|
4153
|
-
writer.write_make_initial_run()
|
|
4154
|
-
|
|
4155
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
4156
|
-
|
|
4157
|
-
writer.write_step_over(hit.thread_id)
|
|
4158
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
4159
|
-
reason=REASON_STEP_OVER,
|
|
4160
|
-
file=target_filename,
|
|
4161
|
-
line=writer.get_line_index_with_content('step main')
|
|
4162
|
-
)
|
|
4163
|
-
|
|
4164
|
-
writer.write_run_thread(hit.thread_id)
|
|
4165
|
-
writer.finished_ok = True
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
@pytest.mark.parametrize(
|
|
4169
|
-
'target_filename',
|
|
4170
|
-
[
|
|
4171
|
-
'_debugger_case_asyncio.py',
|
|
4172
|
-
'_debugger_case_trio.py',
|
|
4173
|
-
]
|
|
4174
|
-
)
|
|
4175
|
-
@pytest.mark.skipif(not IS_CPYTHON or not IS_PY36_OR_GREATER, reason='Only CPython 3.6 onwards')
|
|
4176
|
-
def test_asyncio_step_over_end_of_function(case_setup, target_filename):
|
|
4177
|
-
with case_setup.test_file(target_filename) as writer:
|
|
4178
|
-
line = writer.get_line_index_with_content('break count 2')
|
|
4179
|
-
writer.write_add_breakpoint(line)
|
|
4180
|
-
writer.write_make_initial_run()
|
|
4181
|
-
|
|
4182
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
4183
|
-
|
|
4184
|
-
writer.write_step_over(hit.thread_id)
|
|
4185
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
4186
|
-
reason=REASON_STEP_OVER,
|
|
4187
|
-
name=('sleep', 'wait_task_rescheduled'),
|
|
4188
|
-
)
|
|
4189
|
-
writer.write_run_thread(hit.thread_id)
|
|
4190
|
-
writer.finished_ok = True
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
@pytest.mark.parametrize(
|
|
4194
|
-
'target_filename',
|
|
4195
|
-
[
|
|
4196
|
-
'_debugger_case_asyncio.py',
|
|
4197
|
-
'_debugger_case_trio.py',
|
|
4198
|
-
]
|
|
4199
|
-
)
|
|
4200
|
-
@pytest.mark.skipif(not IS_CPYTHON or not IS_PY36_OR_GREATER, reason='Only CPython 3.6 onwards')
|
|
4201
|
-
def test_asyncio_step_in(case_setup, target_filename):
|
|
4202
|
-
with case_setup.test_file(target_filename) as writer:
|
|
4203
|
-
line = writer.get_line_index_with_content('break count 1')
|
|
4204
|
-
writer.write_add_breakpoint(line)
|
|
4205
|
-
writer.write_make_initial_run()
|
|
4206
|
-
|
|
4207
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
4208
|
-
|
|
4209
|
-
writer.write_step_return(hit.thread_id)
|
|
4210
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
4211
|
-
reason=REASON_STEP_RETURN,
|
|
4212
|
-
file=target_filename,
|
|
4213
|
-
line=writer.get_line_index_with_content('break main')
|
|
4214
|
-
)
|
|
4215
|
-
|
|
4216
|
-
writer.write_step_in(hit.thread_id)
|
|
4217
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
4218
|
-
reason=REASON_STEP_INTO,
|
|
4219
|
-
name=('sleep', 'wait_task_rescheduled'),
|
|
4220
|
-
)
|
|
4221
|
-
|
|
4222
|
-
writer.write_run_thread(hit.thread_id)
|
|
4223
|
-
writer.finished_ok = True
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
@pytest.mark.parametrize(
|
|
4227
|
-
'target_filename',
|
|
4228
|
-
[
|
|
4229
|
-
'_debugger_case_asyncio.py',
|
|
4230
|
-
'_debugger_case_trio.py',
|
|
4231
|
-
]
|
|
4232
|
-
)
|
|
4233
|
-
@pytest.mark.skipif(not IS_CPYTHON or not IS_PY36_OR_GREATER, reason='Only CPython 3.6 onwards')
|
|
4234
|
-
def test_asyncio_step_return(case_setup, target_filename):
|
|
4235
|
-
with case_setup.test_file(target_filename) as writer:
|
|
4236
|
-
line = writer.get_line_index_with_content('break count 1')
|
|
4237
|
-
writer.write_add_breakpoint(line)
|
|
4238
|
-
writer.write_make_initial_run()
|
|
4239
|
-
|
|
4240
|
-
hit = writer.wait_for_breakpoint_hit()
|
|
4241
|
-
|
|
4242
|
-
writer.write_step_return(hit.thread_id)
|
|
4243
|
-
hit = writer.wait_for_breakpoint_hit(
|
|
4244
|
-
reason=REASON_STEP_RETURN,
|
|
4245
|
-
file=target_filename,
|
|
4246
|
-
line=writer.get_line_index_with_content('break main')
|
|
4247
|
-
)
|
|
4248
|
-
|
|
4249
|
-
writer.write_run_thread(hit.thread_id)
|
|
4250
|
-
writer.finished_ok = True
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
def test_notify_stdin(case_setup, pyfile):
|
|
4254
|
-
|
|
4255
|
-
@pyfile
|
|
4256
|
-
def case_stdin():
|
|
4257
|
-
import sys
|
|
4258
|
-
print('Write something:')
|
|
4259
|
-
contents = sys.stdin.readline()
|
|
4260
|
-
print('Found: ' + contents)
|
|
4261
|
-
|
|
4262
|
-
print('TEST SUCEEDED')
|
|
4263
|
-
|
|
4264
|
-
def additional_output_checks(writer, stdout, stderr):
|
|
4265
|
-
assert 'Found: foo' in stdout
|
|
4266
|
-
|
|
4267
|
-
with case_setup.test_file(
|
|
4268
|
-
case_stdin,
|
|
4269
|
-
additional_output_checks=additional_output_checks,
|
|
4270
|
-
) as writer:
|
|
4271
|
-
writer.write_make_initial_run()
|
|
4272
|
-
msg = writer.wait_for_message(CMD_INPUT_REQUESTED, expect_xml=False)
|
|
4273
|
-
assert msg.split('\t')[-1] == 'True'
|
|
4274
|
-
process = writer.process
|
|
4275
|
-
process.stdin.write(b'foo\n')
|
|
4276
|
-
process.stdin.flush()
|
|
4277
|
-
msg = writer.wait_for_message(CMD_INPUT_REQUESTED, expect_xml=False)
|
|
4278
|
-
assert msg.split('\t')[-1] == 'False'
|
|
4279
|
-
|
|
4280
|
-
writer.finished_ok = True
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
def test_frame_eval_mode_corner_case_01(case_setup):
|
|
4284
|
-
|
|
4285
|
-
with case_setup.test_file(
|
|
4286
|
-
'wrong_bytecode/_debugger_case_wrong_bytecode.py',
|
|
4287
|
-
) as writer:
|
|
4288
|
-
line = writer.get_line_index_with_content('break here')
|
|
4289
|
-
writer.write_add_breakpoint(line)
|
|
4290
|
-
writer.write_make_initial_run()
|
|
4291
|
-
hit = writer.wait_for_breakpoint_hit(line=writer.get_line_index_with_content('break here'), file='_debugger_case_wrong_bytecode.py')
|
|
4292
|
-
writer.write_step_over(hit.thread_id)
|
|
4293
|
-
|
|
4294
|
-
hit = writer.wait_for_breakpoint_hit(line=writer.get_line_index_with_content('step 1'), file='_debugger_case_wrong_bytecode.py', reason=REASON_STEP_OVER)
|
|
4295
|
-
writer.write_step_over(hit.thread_id)
|
|
4296
|
-
|
|
4297
|
-
hit = writer.wait_for_breakpoint_hit(line=writer.get_line_index_with_content('step 2'), file='_debugger_case_wrong_bytecode.py', reason=REASON_STEP_OVER)
|
|
4298
|
-
writer.write_step_over(hit.thread_id)
|
|
4299
|
-
|
|
4300
|
-
hit = writer.wait_for_breakpoint_hit(line=writer.get_line_index_with_content('step 3'), file='_debugger_case_wrong_bytecode.py', reason=REASON_STEP_OVER)
|
|
4301
|
-
writer.write_step_over(hit.thread_id)
|
|
4302
|
-
|
|
4303
|
-
hit = writer.wait_for_breakpoint_hit(line=writer.get_line_index_with_content('step 4'), file='_debugger_case_wrong_bytecode.py', reason=REASON_STEP_OVER)
|
|
4304
|
-
writer.write_step_over(hit.thread_id)
|
|
4305
|
-
|
|
4306
|
-
hit = writer.wait_for_breakpoint_hit(line=writer.get_line_index_with_content('step 5'), file='_debugger_case_wrong_bytecode.py', reason=REASON_STEP_OVER)
|
|
4307
|
-
writer.write_run_thread(hit.thread_id)
|
|
4308
|
-
|
|
4309
|
-
writer.finished_ok = True
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
@pytest.mark.skipif(not IS_PY36_OR_GREATER, reason='Only CPython 3.6 onwards')
|
|
4313
|
-
def test_frame_eval_mode_corner_case_02(case_setup):
|
|
4314
|
-
|
|
4315
|
-
with case_setup.test_file(
|
|
4316
|
-
'_bytecode_super.py',
|
|
4317
|
-
) as writer:
|
|
4318
|
-
line = writer.get_line_index_with_content('break here')
|
|
4319
|
-
writer.write_add_breakpoint(line)
|
|
4320
|
-
writer.write_make_initial_run()
|
|
4321
|
-
|
|
4322
|
-
hit = writer.wait_for_breakpoint_hit(line=line, file='_bytecode_super.py')
|
|
4323
|
-
|
|
4324
|
-
writer.write_run_thread(hit.thread_id)
|
|
4325
|
-
|
|
4326
|
-
writer.finished_ok = True
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
@pytest.mark.skipif(not IS_PY36_OR_GREATER, reason='Only CPython 3.6 onwards')
|
|
4330
|
-
def test_frame_eval_mode_corner_case_03(case_setup):
|
|
4331
|
-
|
|
4332
|
-
with case_setup.test_file(
|
|
4333
|
-
'_bytecode_constructs.py',
|
|
4334
|
-
) as writer:
|
|
4335
|
-
line = writer.get_line_index_with_content('break while')
|
|
4336
|
-
writer.write_add_breakpoint(line)
|
|
4337
|
-
writer.write_make_initial_run()
|
|
4338
|
-
|
|
4339
|
-
hit = writer.wait_for_breakpoint_hit(line=line)
|
|
4340
|
-
|
|
4341
|
-
writer.write_step_over(hit.thread_id)
|
|
4342
|
-
hit = writer.wait_for_breakpoint_hit(line=line + 1, reason=REASON_STEP_OVER)
|
|
4343
|
-
|
|
4344
|
-
writer.write_step_over(hit.thread_id) # i.e.: check that the jump target is still ok.
|
|
4345
|
-
hit = writer.wait_for_breakpoint_hit(line=line, reason=REASON_STOP_ON_BREAKPOINT)
|
|
4346
|
-
|
|
4347
|
-
writer.write_step_over(hit.thread_id)
|
|
4348
|
-
hit = writer.wait_for_breakpoint_hit(line=line + 1, reason=REASON_STEP_OVER)
|
|
4349
|
-
|
|
4350
|
-
writer.write_step_over(hit.thread_id)
|
|
4351
|
-
hit = writer.wait_for_breakpoint_hit(line=line, reason=REASON_STOP_ON_BREAKPOINT)
|
|
4352
|
-
|
|
4353
|
-
writer.write_run_thread(hit.thread_id)
|
|
4354
|
-
|
|
4355
|
-
writer.finished_ok = True
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
@pytest.mark.skipif(not IS_PY36_OR_GREATER, reason='Only CPython 3.6 onwards')
|
|
4359
|
-
def test_frame_eval_mode_corner_case_04(case_setup):
|
|
4360
|
-
|
|
4361
|
-
with case_setup.test_file(
|
|
4362
|
-
'_bytecode_constructs.py',
|
|
4363
|
-
) as writer:
|
|
4364
|
-
line = writer.get_line_index_with_content('break for')
|
|
4365
|
-
writer.write_add_breakpoint(line)
|
|
4366
|
-
writer.write_make_initial_run()
|
|
4367
|
-
|
|
4368
|
-
hit = writer.wait_for_breakpoint_hit(line=line)
|
|
4369
|
-
writer.write_run_thread(hit.thread_id)
|
|
4370
|
-
|
|
4371
|
-
hit = writer.wait_for_breakpoint_hit(line=line)
|
|
4372
|
-
writer.write_run_thread(hit.thread_id)
|
|
4373
|
-
|
|
4374
|
-
hit = writer.wait_for_breakpoint_hit(line=line)
|
|
4375
|
-
writer.write_run_thread(hit.thread_id)
|
|
4376
|
-
|
|
4377
|
-
writer.finished_ok = True
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
@pytest.mark.skipif(not IS_PY36_OR_GREATER, reason='Only CPython 3.6 onwards')
|
|
4381
|
-
@pytest.mark.parametrize(
|
|
4382
|
-
'break_name',
|
|
4383
|
-
[
|
|
4384
|
-
'break except',
|
|
4385
|
-
'break with',
|
|
4386
|
-
'break try 1',
|
|
4387
|
-
'break try 2',
|
|
4388
|
-
'break finally 1',
|
|
4389
|
-
'break except 2',
|
|
4390
|
-
'break finally 2',
|
|
4391
|
-
'break finally 3',
|
|
4392
|
-
'break finally 4',
|
|
4393
|
-
'break in dict',
|
|
4394
|
-
'break else',
|
|
4395
|
-
]
|
|
4396
|
-
)
|
|
4397
|
-
def test_frame_eval_mode_corner_case_many(case_setup, break_name):
|
|
4398
|
-
if break_name == 'break finally 4' and sys.version_info[:2] == (3, 9):
|
|
4399
|
-
# This case is currently failing in Python 3.9
|
|
4400
|
-
return
|
|
4401
|
-
|
|
4402
|
-
# Check the constructs where we stop only once and proceed.
|
|
4403
|
-
with case_setup.test_file(
|
|
4404
|
-
'_bytecode_constructs.py',
|
|
4405
|
-
) as writer:
|
|
4406
|
-
line = writer.get_line_index_with_content(break_name)
|
|
4407
|
-
writer.write_add_breakpoint(line)
|
|
4408
|
-
writer.write_make_initial_run()
|
|
4409
|
-
|
|
4410
|
-
hit = writer.wait_for_breakpoint_hit(line=line)
|
|
4411
|
-
writer.write_run_thread(hit.thread_id)
|
|
4412
|
-
|
|
4413
|
-
if break_name == 'break with':
|
|
4414
|
-
if sys.version_info[:2] >= (3, 10):
|
|
4415
|
-
# On Python 3.10 it'll actually backtrack for the
|
|
4416
|
-
# with and thus will execute the line where the
|
|
4417
|
-
# 'with' statement was started again.
|
|
4418
|
-
hit = writer.wait_for_breakpoint_hit(line=line)
|
|
4419
|
-
writer.write_run_thread(hit.thread_id)
|
|
4420
|
-
|
|
4421
|
-
writer.finished_ok = True
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
check_shadowed = [
|
|
4425
|
-
(
|
|
4426
|
-
u'''
|
|
4427
|
-
if __name__ == '__main__':
|
|
4428
|
-
import queue
|
|
4429
|
-
print(queue)
|
|
4430
|
-
''',
|
|
4431
|
-
'queue.py',
|
|
4432
|
-
u'shadowed = True\n'
|
|
4433
|
-
),
|
|
4434
|
-
|
|
4435
|
-
(
|
|
4436
|
-
u'''
|
|
4437
|
-
if __name__ == '__main__':
|
|
4438
|
-
import queue
|
|
4439
|
-
print(queue)
|
|
4440
|
-
''',
|
|
4441
|
-
'queue.py',
|
|
4442
|
-
u'raise AssertionError("error on import")'
|
|
4443
|
-
)
|
|
4444
|
-
]
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
@pytest.mark.parametrize('module_name_and_content', check_shadowed)
|
|
4448
|
-
def test_debugger_shadowed_imports(case_setup, tmpdir, module_name_and_content):
|
|
4449
|
-
main_content, module_name, content = module_name_and_content
|
|
4450
|
-
target = tmpdir.join('main.py')
|
|
4451
|
-
shadowed = tmpdir.join(module_name)
|
|
4452
|
-
|
|
4453
|
-
target.write_text(main_content, encoding='utf-8')
|
|
4454
|
-
|
|
4455
|
-
shadowed.write_text(content, encoding='utf-8')
|
|
4456
|
-
|
|
4457
|
-
def get_environ(writer):
|
|
4458
|
-
env = os.environ.copy()
|
|
4459
|
-
env.update({
|
|
4460
|
-
'PYTHONPATH': str(tmpdir),
|
|
4461
|
-
})
|
|
4462
|
-
return env
|
|
4463
|
-
|
|
4464
|
-
try:
|
|
4465
|
-
with case_setup.test_file(
|
|
4466
|
-
str(target),
|
|
4467
|
-
get_environ=get_environ,
|
|
4468
|
-
wait_for_initialization=False,
|
|
4469
|
-
) as writer:
|
|
4470
|
-
writer.write_make_initial_run()
|
|
4471
|
-
except AssertionError:
|
|
4472
|
-
pass # This is expected as pydevd didn't start-up.
|
|
4473
|
-
|
|
4474
|
-
assert ('the module "%s" could not be imported because it is shadowed by:' % (module_name.split('.')[0])) in writer.get_stderr()
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
def test_debugger_hide_pydevd_threads(case_setup, pyfile):
|
|
4478
|
-
|
|
4479
|
-
@pyfile
|
|
4480
|
-
def target_file():
|
|
4481
|
-
import threading
|
|
4482
|
-
from _pydevd_bundle import pydevd_constants
|
|
4483
|
-
found_pydevd_thread = False
|
|
4484
|
-
for t in threading.enumerate():
|
|
4485
|
-
if getattr(t, 'is_pydev_daemon_thread', False):
|
|
4486
|
-
found_pydevd_thread = True
|
|
4487
|
-
|
|
4488
|
-
if pydevd_constants.IS_CPYTHON:
|
|
4489
|
-
assert not found_pydevd_thread
|
|
4490
|
-
else:
|
|
4491
|
-
assert found_pydevd_thread
|
|
4492
|
-
print('TEST SUCEEDED')
|
|
4493
|
-
|
|
4494
|
-
with case_setup.test_file(target_file) as writer:
|
|
4495
|
-
line = writer.get_line_index_with_content('TEST SUCEEDED')
|
|
4496
|
-
writer.write_add_breakpoint(line)
|
|
4497
|
-
writer.write_make_initial_run()
|
|
4498
|
-
|
|
4499
|
-
hit = writer.wait_for_breakpoint_hit(line=line)
|
|
4500
|
-
writer.write_run_thread(hit.thread_id)
|
|
4501
|
-
writer.finished_ok = True
|
|
4502
|
-
|
|
4503
|
-
# Jython needs some vars to be set locally.
|
|
4504
|
-
# set JAVA_HOME=c:\bin\jdk1.8.0_172
|
|
4505
|
-
# set PATH=%PATH%;C:\bin\jython2.7.0\bin
|
|
4506
|
-
# set PATH=%PATH%;%JAVA_HOME%\bin
|
|
4507
|
-
# c:\bin\jython2.7.0\bin\jython.exe -m py.test tests_python
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
if __name__ == '__main__':
|
|
4511
|
-
pytest.main(['-k', 'test_case_12'])
|