mirror of
https://github.com/python/cpython.git
synced 2025-11-25 12:44:13 +00:00
GH-103082: Filter LINE events in VM, to simplify tool implementation. (GH-104387)
When monitoring LINE events, instrument all instructions that can have a predecessor on a different line. Then check that the a new line has been hit in the instrumentation code. This brings the behavior closer to that of 3.11, simplifying implementation and porting of tools.
This commit is contained in:
parent
19ee53d52e
commit
45f5aa8fc7
16 changed files with 255 additions and 161 deletions
|
|
@ -831,7 +831,6 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignore
|
|||
start_stack = pop_value(start_stack);
|
||||
}
|
||||
/* Finally set the new lasti and return OK. */
|
||||
f->f_last_traced_line = new_lineno;
|
||||
f->f_lineno = 0;
|
||||
f->f_frame->prev_instr = _PyCode_CODE(f->f_frame->f_code) + best_addr;
|
||||
return 0;
|
||||
|
|
@ -854,7 +853,6 @@ frame_settrace(PyFrameObject *f, PyObject* v, void *closure)
|
|||
}
|
||||
if (v != f->f_trace) {
|
||||
Py_XSETREF(f->f_trace, Py_XNewRef(v));
|
||||
f->f_last_traced_line = -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1056,7 +1054,6 @@ _PyFrame_New_NoTrack(PyCodeObject *code)
|
|||
f->f_trace_opcodes = 0;
|
||||
f->f_fast_as_locals = 0;
|
||||
f->f_lineno = 0;
|
||||
f->f_last_traced_line = -1;
|
||||
return f;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue