Beispiel #1
0
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
Beispiel #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
Beispiel #3
0
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)
Beispiel #4
0
 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
Beispiel #5
0
 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
Beispiel #6
0
 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
Beispiel #7
0
 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
Beispiel #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)
Beispiel #9
0
 def f():
     return fetch_translated_config().translation.continuation
Beispiel #10
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
Beispiel #11
0
 def f():
     return fetch_translated_config().translation.continuation