[pypy-commit] pypy reverse-debugger: Threads: in-progress

arigo pypy.commits at gmail.com
Thu Aug 11 12:02:24 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: reverse-debugger
Changeset: r86153:a852dc954edc
Date: 2016-08-11 18:01 +0200
http://bitbucket.org/pypy/pypy/changeset/a852dc954edc/

Log:	Threads: in-progress

diff --git a/pypy/interpreter/reverse_debugging.py b/pypy/interpreter/reverse_debugging.py
--- a/pypy/interpreter/reverse_debugging.py
+++ b/pypy/interpreter/reverse_debugging.py
@@ -591,6 +591,13 @@
     # This class is tweaked to generate one byte per _SIG_TICKER_COUNT
     # bytecodes, at the expense of not reacting to signals instantly.
 
+    # Threads: after 10'000 calls to decrement_ticker(), it should
+    # return -1.  It should also return -1 if there was a signal.
+    # This is done by calling _update_ticker_from_signals() every 100
+    # calls, and invoking rsignal.pypysig_check_and_reset(); this in
+    # turn returns -1 if there was a signal or if it was called 100
+    # times.
+
     _SIG_TICKER_COUNT = 100
     _ticker = 0
     _ticker_count = _SIG_TICKER_COUNT * 10
@@ -610,10 +617,10 @@
             if c < 0:
                 c = self._update_ticker_from_signals()
             self._ticker_count = c
-        if self.has_bytecode_counter:    # this 'if' is constant-folded
-            print ("RDBSignalActionFlag: has_bytecode_counter: "
-                   "not supported for now")
-            raise NotImplementedError
+        #if self.has_bytecode_counter:    # this 'if' is constant-folded
+        #    print ("RDBSignalActionFlag: has_bytecode_counter: "
+        #           "not supported for now")
+        #    raise NotImplementedError
         return self._ticker
 
     def _update_ticker_from_signals(self):
diff --git a/rpython/translator/c/src/signals.h b/rpython/translator/c/src/signals.h
--- a/rpython/translator/c/src/signals.h
+++ b/rpython/translator/c/src/signals.h
@@ -39,8 +39,9 @@
 
 inline static char pypysig_check_and_reset(void) {
     /* used by reverse_debugging */
-    char result = pypysig_counter.value < 0;
-    pypysig_counter.value = 0;
+    char result = --pypysig_counter.value < 0;
+    if (result)
+        pypysig_counter.value = 100;
     return result;
 }
 


More information about the pypy-commit mailing list