mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Extend RemoteUnwinder to capture precise bytecode locations
Introduces LocationInfo struct sequence with end_lineno, col_offset, and end_col_offset fields. Adds opcodes parameter to RemoteUnwinder that extracts the currently executing opcode alongside its source span. Refactors linetable parsing to correctly accumulate line numbers separately from output values, fixing edge cases in computed_line.
This commit is contained in:
parent
8801c6dec7
commit
dd27e5e679
5 changed files with 146 additions and 46 deletions
|
|
@ -310,9 +310,9 @@ process_frame_chain(
|
|||
extra_frame = &_Py_STR(native);
|
||||
}
|
||||
if (extra_frame) {
|
||||
// Use "~" as file and 0 as line, since that's what pstats uses:
|
||||
// Use "~" as file, None as location (synthetic frame), None as opcode
|
||||
PyObject *extra_frame_info = make_frame_info(
|
||||
unwinder, _Py_LATIN1_CHR('~'), _PyLong_GetZero(), extra_frame);
|
||||
unwinder, _Py_LATIN1_CHR('~'), Py_None, extra_frame, Py_None);
|
||||
if (extra_frame_info == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue