Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change sys.settrace opcode tracing to occur after frame line number update #75799

Closed
gwk mannequin opened this issue Sep 28, 2017 · 3 comments
Closed

Change sys.settrace opcode tracing to occur after frame line number update #75799

gwk mannequin opened this issue Sep 28, 2017 · 3 comments
Labels
3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error

Comments

@gwk
Copy link
Mannequin

gwk mannequin commented Sep 28, 2017

BPO 31618
Nosy @ncoghlan, @nedbat, @njsmith, @serhiy-storchaka, @gwk
PRs
  • bpo-31618: Move opcode tracing to occur after the possible update to f_lineno. #3798
  • bpo-31618: Add NEWS entry for opcode tracing change. #4045
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-10-19.07:44:47.153>
    created_at = <Date 2017-09-28.12:40:03.218>
    labels = ['type-bug', '3.7']
    title = 'Change sys.settrace opcode tracing to occur after frame line number update'
    updated_at = <Date 2017-10-19.07:44:47.151>
    user = 'https://github.com/gwk'

    bugs.python.org fields:

    activity = <Date 2017-10-19.07:44:47.151>
    actor = 'ncoghlan'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-10-19.07:44:47.153>
    closer = 'ncoghlan'
    components = []
    creation = <Date 2017-09-28.12:40:03.218>
    creator = 'gwk'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31618
    keywords = ['patch']
    message_count = 3.0
    messages = ['303225', '303226', '304605']
    nosy_count = 5.0
    nosy_names = ['ncoghlan', 'nedbat', 'njs', 'serhiy.storchaka', 'gwk']
    pr_nums = ['3798', '4045']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue31618'
    versions = ['Python 3.7']

    @gwk
    Copy link
    Mannequin Author

    gwk mannequin commented Sep 28, 2017

    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.

    @gwk gwk mannequin added 3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error labels Sep 28, 2017
    @gwk
    Copy link
    Mannequin Author

    gwk mannequin commented Sep 28, 2017

    The feature was was implemented in bpo-31344. See bpo-29400 for my parallel effort, which has been abandoned.

    @ncoghlan
    Copy link
    Contributor

    Thanks for the fix!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant