Beispiel #1
0
 def from_frame(cls, frame, debugger: bdb.Bdb):
     code = frame.f_code
     return cls(
         funcname=code.co_name,
         filename=debugger.canonic(code.co_filename),
         linenum=frame.f_lineno,
     )
Beispiel #2
0
    def from_frame(cls, frame, debugger: bdb.Bdb):
        code = frame.f_code

        # Uncomment to see the bytecode
        # b = dis.Bytecode(frame.f_code, current_offset=frame.f_lasti)
        # print(b.dis(), file=sys.__stderr__)

        return cls(
            filename=debugger.canonic(code.co_filename),
            linenum=frame.f_lineno,
            inst_index=frame.f_lasti,
        )