コード例 #1
0
ファイル: revdb.py プロジェクト: soIu/rpython
def flag_io_disabled():
    """Returns True if we're in the debugger typing commands."""
    if we_are_translated():
        if fetch_translated_config().translation.reverse_debugger:
            flag = llop.revdb_get_value(lltype.Signed, 'i')
            return flag != ord('R')  # FID_REGULAR_MODE
    return False
コード例 #2
0
    def test_fetch_translated_config(self):
        assert fetch_translated_config() is None

        def f():
            return fetch_translated_config().translation.continuation

        res = self.interpret(f, [])
        assert res is False
コード例 #3
0
ファイル: revdb.py プロジェクト: soIu/rpython
def stop_point(place=0):
    """Indicates a point in the execution of the RPython program where
    the reverse-debugger can stop.  When reverse-debugging, we see
    the "time" as the index of the stop-point that happened.
    """
    if we_are_translated():
        if fetch_translated_config().translation.reverse_debugger:
            llop.revdb_stop_point(lltype.Void, place)
コード例 #4
0
ファイル: rstacklet.py プロジェクト: abhinavthomas/pypy
 def __init__(self, _argument_ignored_for_backward_compatibility=None):
     self._gcrootfinder = _getgcrootfinder(fetch_translated_config())
     self._thrd = _c.newthread()
     if not self._thrd:
         raise MemoryError
     self._thrd_deleter = StackletThreadDeleter(self._thrd)
     if DEBUG:
         assert debug.sthread is None, "multithread debug support missing"
         debug.sthread = self
コード例 #5
0
ファイル: rstacklet.py プロジェクト: sota/pypy-old
 def __init__(self, _argument_ignored_for_backward_compatibility=None):
     self._gcrootfinder = _getgcrootfinder(fetch_translated_config())
     self._thrd = _c.newthread()
     if not self._thrd:
         raise MemoryError
     self._thrd_deleter = StackletThreadDeleter(self._thrd)
     if DEBUG:
         assert debug.sthread is None, "multithread debug support missing"
         debug.sthread = self
コード例 #6
0
ファイル: test_rthread.py プロジェクト: sota/pypy-old
 def f():
     config = objectmodel.fetch_translated_config()
     assert t.automatic_keepalive(config) is True
     wr = tset()
     import gc; gc.collect()   # 'x1' should not be collected
     x2 = t.get()
     assert x2 is not None
     assert wr() is not None
     assert wr() is x2
     return wr
コード例 #7
0
ファイル: test_rthread.py プロジェクト: soIu/rpython
 def f():
     config = objectmodel.fetch_translated_config()
     assert t.automatic_keepalive(config) is True
     wr = tset()
     wr2 = t2set()
     import gc
     gc.collect()  # the two 'x1' should not be collected
     x1 = t.get()
     assert x1 is not None
     assert wr() is not None
     assert wr() is x1
     assert x1.lst == [40, 2]
     x2 = t2.get()
     assert x2 is not None
     assert wr2() is not None
     assert wr2() is x2
     assert x2.lst == [50, 3]
     return wr, wr2
コード例 #8
0
def stack_check():
    if not we_are_translated():
        return
    if fetch_translated_config().translation.reverse_debugger:
        return  # XXX for now
    #
    # Load the "current" stack position, or at least some address that
    # points close to the current stack head
    current = llop.stack_current(lltype.Signed)
    #
    # Load these variables from C code
    end = _stack_get_end()
    length = _stack_get_length()
    #
    # Common case: if 'current' is within [end-length:end], everything
    # is fine
    ofs = r_uint(end - current)
    if ofs <= r_uint(length):
        return
    #
    # Else call the slow path
    stack_check_slowpath(current)
コード例 #9
0
ファイル: test_objectmodel.py プロジェクト: mozillazg/pypy
 def f():
     return fetch_translated_config().translation.continuation
コード例 #10
0
ファイル: test_objectmodel.py プロジェクト: mozillazg/pypy
 def test_fetch_translated_config(self):
     assert fetch_translated_config() is None
     def f():
         return fetch_translated_config().translation.continuation
     res = self.interpret(f, [])
     assert res is False
コード例 #11
0
 def f():
     return fetch_translated_config().translation.continuation