mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
PY-78449 Debugger completely broken in PY-251.15449
Regenerate Cython files for Windows Regenerate Cython files for MacOS Merge-request: IJ-MR-152850 Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com> (cherry picked from commit c506acd0c0f35c542b52fb7c41075f552a5258b3) IJ-MR-152850 GitOrigin-RevId: ac83063ed1280659f4e759d88be3ed89798f30b6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
172f70cd40
commit
55ce70bcba
@@ -7,7 +7,7 @@ from _pydev_bundle import pydev_log
|
||||
from _pydevd_bundle.pydevd_frame import PyDBFrame
|
||||
# ENDIF
|
||||
|
||||
version = 51
|
||||
version = 52
|
||||
|
||||
if not hasattr(sys, '_current_frames'):
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ pydev_log.debug("Using Cython speedups")
|
||||
# from _pydevd_bundle.pydevd_frame import PyDBFrame
|
||||
# ENDIF
|
||||
|
||||
version = 51
|
||||
version = 52
|
||||
|
||||
if not hasattr(sys, '_current_frames'):
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -41,6 +41,10 @@ try:
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
_EVENT_ACTIONS = {
|
||||
"ADD": lambda x, y: x | y,
|
||||
"REMOVE": lambda x, y: x & ~y,
|
||||
}
|
||||
|
||||
def _make_frame_cache_key(code):
|
||||
return code.co_firstlineno, code.co_name, code.co_filename
|
||||
@@ -127,6 +131,10 @@ def _should_enable_line_events_for_code(frame, code, filename, info):
|
||||
# will match either global or some function
|
||||
if breakpoint.func_name in ('None', curr_func_name):
|
||||
has_breakpoint_in_frame = True
|
||||
# New breakpoint was processed -> stop tracing monitoring.events.INSTRUCTION
|
||||
if getattr(breakpoint, '_not_processed', None):
|
||||
breakpoint._not_processed = False
|
||||
_modify_global_events(_EVENT_ACTIONS["REMOVE"], monitoring.events.INSTRUCTION)
|
||||
break
|
||||
|
||||
# Check is f_back has a breakpoint => need register return event
|
||||
@@ -206,6 +214,7 @@ def enable_pep669_monitoring():
|
||||
(monitoring.events.LINE, py_line_callback),
|
||||
(monitoring.events.PY_RETURN, py_return_callback),
|
||||
(monitoring.events.RAISE, py_raise_callback),
|
||||
(monitoring.events.INSTRUCTION, instruction_callback),
|
||||
):
|
||||
monitoring.register_callback(DEBUGGER_ID, event_type, callback)
|
||||
|
||||
@@ -214,6 +223,20 @@ def enable_pep669_monitoring():
|
||||
debugger.is_pep669_monitoring_enabled = True
|
||||
|
||||
|
||||
def process_new_breakpoint(breakpoint):
|
||||
breakpoint._not_processed = True
|
||||
_modify_global_events(_EVENT_ACTIONS["ADD"], monitoring.events.INSTRUCTION)
|
||||
|
||||
|
||||
def _modify_global_events(action, event):
|
||||
DEBUGGER_ID = monitoring.DEBUGGER_ID
|
||||
if not monitoring.get_tool(DEBUGGER_ID):
|
||||
return
|
||||
|
||||
current_events = monitoring.get_events(DEBUGGER_ID)
|
||||
monitoring.set_events(DEBUGGER_ID, action(current_events, event))
|
||||
|
||||
|
||||
def _enable_return_tracing(code):
|
||||
local_events = monitoring.get_local_events(monitoring.DEBUGGER_ID, code)
|
||||
monitoring.set_local_events(monitoring.DEBUGGER_ID, code,
|
||||
@@ -226,6 +249,57 @@ def _enable_line_tracing(code):
|
||||
local_events | monitoring.events.LINE)
|
||||
|
||||
|
||||
def instruction_callback(code, instruction_offset):
|
||||
try:
|
||||
py_db = GlobalDebuggerHolder.global_dbg
|
||||
except AttributeError:
|
||||
return
|
||||
if py_db is None:
|
||||
return monitoring.DISABLE
|
||||
|
||||
frame = _getframe(1)
|
||||
# print('ENTER: INSTRUCTION ', code.co_filename, frame.f_lineno, code.co_name)
|
||||
|
||||
try:
|
||||
if py_db._finish_debugging_session:
|
||||
return monitoring.DISABLE
|
||||
|
||||
thread = get_current_thread()
|
||||
|
||||
if not is_thread_alive(thread):
|
||||
return
|
||||
|
||||
frame_cache_key = _make_frame_cache_key(code)
|
||||
|
||||
info = _get_additional_info(thread)
|
||||
pydev_step_cmd = info.pydev_step_cmd
|
||||
is_stepping = pydev_step_cmd != -1
|
||||
|
||||
if not is_stepping and frame_cache_key in global_cache_skips:
|
||||
return
|
||||
|
||||
abs_path_real_path_and_base = _get_abs_path_real_path_and_base_from_frame(frame)
|
||||
filename = abs_path_real_path_and_base[1]
|
||||
|
||||
breakpoints_for_file = (py_db.breakpoints.get(filename)
|
||||
or py_db.has_plugin_line_breaks)
|
||||
if not breakpoints_for_file and not is_stepping:
|
||||
return
|
||||
|
||||
if _should_enable_line_events_for_code(frame, code, filename, info):
|
||||
_enable_line_tracing(code)
|
||||
_enable_return_tracing(code)
|
||||
except SystemExit:
|
||||
return monitoring.DISABLE
|
||||
except Exception:
|
||||
try:
|
||||
if traceback is not None:
|
||||
traceback.print_exc()
|
||||
except:
|
||||
pass
|
||||
return monitoring.DISABLE
|
||||
|
||||
|
||||
def py_start_callback(code, instruction_offset):
|
||||
try:
|
||||
py_db = GlobalDebuggerHolder.global_dbg
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user