[pypy-commit] pypy reverse-debugger: External function calls

arigo pypy.commits at gmail.com
Mon Jun 6 02:54:20 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: reverse-debugger
Changeset: r84960:f7fe5ea0f6d4
Date: 2016-06-06 08:55 +0200
http://bitbucket.org/pypy/pypy/changeset/f7fe5ea0f6d4/

Log:	External function calls

diff --git a/rpython/translator/c/funcgen.py b/rpython/translator/c/funcgen.py
--- a/rpython/translator/c/funcgen.py
+++ b/rpython/translator/c/funcgen.py
@@ -391,11 +391,16 @@
             # skip assignment of 'void' return value
             r = self.expr(v_result)
             line = '%s = %s' % (r, line)
-        if targets:
+        else:
+            r = None
+        if targets is not None:
             for graph in targets:
                 if getattr(graph, 'inhibit_tail_call', False):
                     line += '\nPYPY_INHIBIT_TAIL_CALL();'
                     break
+        elif self.db.reverse_debugger:
+            from rpython.translator.revdb import revdb_genc
+            line += '\n' + revdb_genc.emit(self.lltypename(v_result), r)
         return line
 
     def OP_DIRECT_CALL(self, op):
diff --git a/rpython/translator/revdb/test/test_basic.py b/rpython/translator/revdb/test/test_basic.py
--- a/rpython/translator/revdb/test/test_basic.py
+++ b/rpython/translator/revdb/test/test_basic.py
@@ -79,6 +79,9 @@
                 c2 = rdb.next('c')
                 assert c2 == c1
             got.append(''.join(s))
+        # write() call
+        x = rdb.next(); assert x == len('[abc, d]\n')
+        x = rdb.next('i'); assert x == 0      # errno
         # that's all that should get from this simple example
         assert rdb.done()
         #


More information about the pypy-commit mailing list