[issue40228] Make setting line number in frame more robust.

Mark Shannon report at bugs.python.org
Wed Apr 8 11:47:35 EDT 2020


New submission from Mark Shannon <mark at hotpy.org>:

Debuggers are allowed to change the line number of the currently executing frame. Regardless of whether this is sensible or not, the current implementation rather fragile.

The code makes various assumptions about the layout of the bytecode that may not be true in the future, and I suspect, are not true now.

We should use a more brute-force approach of computing the exception stack for the whole function and then searching for a safe place to jump to. This is not only more robust it allows more jumps.

For example, it is safe to jump from one exception handler to another.
It may not be sensible, but it is safe.

----------
components: 2to3 (2.x to 3.x conversion tool)
messages: 365990
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Make setting line number in frame more robust.

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40228>
_______________________________________


More information about the Python-bugs-list mailing list