Author: Manuel Jacob <m...@manueljacob.de>
Branch: reverse-debugger-updated
Changeset: r94063:0365344dd2f6
Date: 2018-03-22 12:56 +0100
http://bitbucket.org/pypy/pypy/changeset/0365344dd2f6/

Log:    Fix replaying by adding back hash field to GC header.

diff --git a/rpython/memory/gctransform/boehm.py 
b/rpython/memory/gctransform/boehm.py
--- a/rpython/memory/gctransform/boehm.py
+++ b/rpython/memory/gctransform/boehm.py
@@ -28,7 +28,7 @@
         ll_malloc_varsize_no_length = mh.ll_malloc_varsize_no_length
         ll_malloc_varsize = mh.ll_malloc_varsize
 
-        fields = []
+        fields = [("hash", lltype.Signed)]
         if translator and translator.config.translation.reverse_debugger:
             fields.append(("uid", lltype.SignedLongLong))
         hints = {'hints': {'gcheader': True}}
diff --git a/rpython/translator/revdb/src-revdb/revdb.c 
b/rpython/translator/revdb/src-revdb/revdb.c
--- a/rpython/translator/revdb/src-revdb/revdb.c
+++ b/rpython/translator/revdb/src-revdb/revdb.c
@@ -410,8 +410,17 @@
 RPY_EXTERN
 Signed rpy_reverse_db_identityhash(struct pypy_header0 *obj)
 {
-    /* XXX This will make all prebuilt objects have id-hash 0. */
-    return obj->h_uid;
+    /* Boehm only */
+    if (obj->h_hash == 0) {
+        /* We never need to record anything: if h_hash is zero (which
+           is the case for all newly allocated objects), then we just
+           copy h_uid.  This gives a stable answer.  This would give
+           0 for all prebuilt objects, but these should not have a
+           null h_hash anyway.
+        */
+        obj->h_hash = obj->h_uid;
+    }
+    return obj->h_hash;
 }
 
 RPY_EXTERN
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to