Skip to content

Fix a bug #46

@jfongattw

Description

@jfongattw

In CalcScopeLine(), when insert the line "print(rvl)" below "rvl.reverse()", sometimes you can see wrong lineno
which is larger than the debugee file has. This error was caused by CalcValidLines() which is buggy.
Replace it with the following new def can get rid of this bug and makes rpdb2 more reliable.

import dis
def CalcValidLines(code):
return sorted({lineno for _, lineno in dis.findlinestarts(code)})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions