This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Change sys.settrace opcode tracing to occur after frame line number update
Type: behavior Stage: resolved
Components: Versions: Python 3.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gwk, ncoghlan, nedbat, njs, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2017-09-28 12:40 by gwk, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 3798 merged gwk, 2017-09-28 12:40
PR 4045 merged gwk, 2017-10-19 07:40
Messages (3)
msg303225 - (view) Author: George King (gwk) * Date: 2017-09-28 12:40
This patch moves the new opcode tracing added in commit 5a85167 to happen after frame->f_lineno is updated. With this patch, when both f_trace_lines and f_trace_opcodes are enabled the trace function will see the same line number for both the 'line' and 'opcode' events.

A side effect of this patch is that the order of event emission has been switched; 'line' now happens before 'opcode'. Maintaining the current order would require more elaborate logic.
msg303226 - (view) Author: George King (gwk) * Date: 2017-09-28 12:45
The feature was was implemented in bpo-31344. See bpo-29400 for my parallel effort, which has been abandoned.
msg304605 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2017-10-19 07:44
Thanks for the fix!
Date User Action Args
2022-04-11 14:58:52adminsetgithub: 75799
2017-10-19 07:44:47ncoghlansetstatus: open -> closed
resolution: fixed
messages: + msg304605

stage: patch review -> resolved
2017-10-19 07:40:42gwksetkeywords: + patch
stage: patch review
pull_requests: + pull_request4017
2017-09-28 12:45:41gwksetmessages: + msg303226
2017-09-28 12:40:03gwkcreate