[pypy-commit] lang-smalltalk default: Changed the fail primitive to better print in case of DNU and not halting (allowing for endless loops.

lwassermann noreply at buildbot.pypy.org
Tue Aug 6 14:54:31 CEST 2013


Author: Lars Wassermann <lars.wassermann at gmail.com>
Branch: 
Changeset: r509:b2990d16a4e8
Date: 2013-07-20 23:16 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/b2990d16a4e8/

Log:	Changed the fail primitive to better print in case of DNU and not
	halting (allowing for endless loops. Increased the initial priority
	for the injected process in old images to 8(/9).

diff --git a/spyvm/primitives.py b/spyvm/primitives.py
--- a/spyvm/primitives.py
+++ b/spyvm/primitives.py
@@ -369,10 +369,11 @@
         print ''
         print s_frame.print_stack()
         w_message = s_frame.peek(0)
-        print w_message.as_repr_string()
+        print ("%s" % w_message).replace('\r', '\n')
+        print ("%s" % s_frame.peek(1)).replace('\r', '\n')
         if isinstance(w_message, model.W_PointersObject):
-            print w_message._vars
-        raise Exit('Probably Debugger called...')
+            print ('%s' % w_message._vars).replace('\r', '\n')
+        # raise Exit('Probably Debugger called...')
     raise PrimitiveFailedError()
 
 # ___________________________________________________________________________
@@ -634,7 +635,6 @@
         w_bitmap = w_dest_form.fetch(space, 0)
         assert isinstance(w_bitmap, model.W_DisplayBitmap)
         w_bitmap.flush_to_screen()
-    return w_rcvr
 
     # try:
     #     s_frame._sendSelfSelector(interp.image.w_simulateCopyBits, 0, interp)
@@ -645,8 +645,8 @@
     #         assert isinstance(w_bitmap, model.W_DisplayBitmap)
     #         w_bitmap.flush_to_screen()
 
-    # # in case we return normally, we have to restore the removed w_rcvr
-    # return w_rcvr
+    # in case we return normally, we have to restore the removed w_rcvr
+    return w_rcvr
 
 @expose_primitive(BE_CURSOR)
 def func(interp, s_frame, argcount):
diff --git a/targetimageloadingsmalltalk.py b/targetimageloadingsmalltalk.py
--- a/targetimageloadingsmalltalk.py
+++ b/targetimageloadingsmalltalk.py
@@ -34,6 +34,8 @@
     # Priorities below 10 are not allowed in newer versions of Squeak.
     if interp.image.version.has_closures:
         priority = max(11, priority)
+    else:
+        priority = 7
     w_benchmark_proc.store(space, 2, space.wrap_int(priority))
 
     # make process eligible for scheduling


More information about the pypy-commit mailing list