Beispiel #1
0
def stop_point_activate(place=0, pycode=None, opindex=-1):
    if revdb.watch_save_state():
        any_watch_point = False
        # ^^ this flag is set to True if we must continue to enter this
        # block of code.  If it is still False for watch_restore_state()
        # below, then future watch_save_state() will return False too---
        # until the next time revdb.c:set_revdb_breakpoints() is called.
        space = dbstate.space
        with non_standard_code:
            watch_id = -1
            if dbstate.breakpoint_by_file is not None:
                any_watch_point = True
                if pycode is not None:
                    watch_id = check_and_trigger_bkpt(pycode, opindex)
            if watch_id == -1:
                for prog, watch_id, expected in dbstate.watch_progs:
                    any_watch_point = True
                    try:
                        got = _run_watch(space, prog)
                    except OperationError as e:
                        got = e.errorstr(space)
                    except Exception:
                        break
                    if got != expected:
                        break
                else:
                    watch_id = -1
        revdb.watch_restore_state(any_watch_point)
        if watch_id != -1:
            revdb.breakpoint(watch_id)
    revdb.stop_point(place)
Beispiel #2
0
def enter_call(caller_frame, callee_frame):
    if dbstate.breakpoint_funcnames is not None:
        name = callee_frame.getcode().co_name
        if name in dbstate.breakpoint_funcnames:
            revdb.breakpoint(dbstate.breakpoint_funcnames[name])
    if dbstate.breakpoint_stack_id != 0 and caller_frame is not None:
        if dbstate.breakpoint_stack_id == revdb.get_unique_id(caller_frame):
            revdb.breakpoint(-1)
    #
    code = callee_frame.pycode
    if code.co_revdb_linestarts is None:
        build_co_revdb_linestarts(code)
Beispiel #3
0
 def main(argv):
     revdb.register_debug_command(100, lambda_blip)
     revdb.register_debug_command(CMD_PRINT, lambda_print)
     revdb.register_debug_command(CMD_ATTACHID, lambda_attachid)
     revdb.register_debug_command("ALLOCATING", lambda_allocating)
     revdb.register_debug_command(revdb.CMD_COMPILEWATCH,
                                  lambda_compilewatch)
     revdb.register_debug_command(revdb.CMD_CHECKWATCH,
                                  lambda_checkwatch)
     for i, op in enumerate(argv[1:]):
         dbstate.stuff = Stuff()
         dbstate.stuff.x = i + 1000
         if i == dbstate.break_loop or i == dbstate.break_loop + 1:
             revdb.breakpoint(99)
         revdb.stop_point()
         print op
     return 9
Beispiel #4
0
def stop_point():
    if we_are_translated():
        revdb.breakpoint(-3)
Beispiel #5
0
def leave_call(caller_frame, got_exception):
    if dbstate.breakpoint_stack_id != 0 and caller_frame is not None:
        if dbstate.breakpoint_stack_id == revdb.get_unique_id(caller_frame):
            revdb.breakpoint(-2)
    if we_are_translated():
        stop_point_activate(-2 + got_exception)