develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35110 - trunk/languages/befunge

From:
jquelin
Date:
January 7, 2009 02:58
Subject:
[svn:parrot] r35110 - trunk/languages/befunge
Message ID:
20090107105759.EAED3CB9F9@x12.develooper.com
Author: jquelin
Date: Wed Jan  7 02:57:57 2009
New Revision: 35110

Modified:
   trunk/languages/befunge/befunge.pir
   trunk/languages/befunge/debug.pir

Log:
starting implementation in debug


Modified: trunk/languages/befunge/befunge.pir
==============================================================================
--- trunk/languages/befunge/befunge.pir	(original)
+++ trunk/languages/befunge/befunge.pir	Wed Jan  7 02:57:57 2009
@@ -56,7 +56,7 @@
     val  = playfield[y;x]
     char = chr val
     if debug == 0 goto TICK_NODEBUG
-    #bsr DEBUG_CHECK_BREAKPOINT
+    debug__check_breakpoint()
   TICK_NODEBUG:
 
 =pod

Modified: trunk/languages/befunge/debug.pir
==============================================================================
--- trunk/languages/befunge/debug.pir	(original)
+++ trunk/languages/befunge/debug.pir	Wed Jan  7 02:57:57 2009
@@ -31,11 +31,27 @@
 .end
 
 
-=pod
+.sub "_debug__interact"
+.end
+
 
 # Check whether we should stop the interpreter at the current
 # moment, allowing user to play with the debugger.
-DEBUG_CHECK_BREAKPOINT:
+.sub "debug__check_breakpoint"
+    .local pmc step
+
+    step = get_global "step"
+    if step == 0 goto DEBUG__CHECK_BREAKPOINT__CHAR
+    _debug__interact()
+    goto DEBUG__CHECK_BREAKPOINT__END
+
+  DEBUG__CHECK_BREAKPOINT__CHAR:
+  DEBUG__CHECK_BREAKPOINT__END:
+
+.end
+
+=pod
+
         set I10, P3[0]
         eq 0, I10, DEBUG_CHECK_BREAKPOINT_CHAR
         bsr DEBUG_INTERACT
@@ -72,8 +88,14 @@
         bsr DEBUG_INTERACT
         # Fallback
         # branch DEBUG_CHECK_BREAKPOINT_END
-DEBUG_CHECK_BREAKPOINT_END:
-        ret
+
+
+  DEBUG__CHECK_BREAKPOINT__END:
+    .return()
+
+.end
+
+=pod
 
 
 # The interpreter has reached a breakpoint. Let's



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About