# New Ticket Created by  Jerome Quelin 
# Please include the string:  [perl #18793]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=18793 >


>From the Changes file:
  - debugger can now interact with user.
  - debugger can dump playfield.
  - debugger can print information about current IP.
  - debugger can execute a befunge program step by step.

Next step: introduce breakpoint support...

Jerome
-- 
[EMAIL PROTECTED]


-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/43626/34713/348f93/befunge_debugger_dump_step.patch

? befunge.pbc
Index: Changes
===================================================================
RCS file: /cvs/public/parrot/languages/befunge/Changes,v
retrieving revision 1.3
diff -u -d -r1.3 Changes
--- Changes	30 Nov 2002 15:51:09 -0000	1.3
+++ Changes	1 Dec 2002 09:08:29 -0000
@@ -1,5 +1,11 @@
 Revision history for Befunge-93 interpreter written for Parrot.
 
+0.06  Sun Dec  1 10:00:35 CET 2002
+        - debugger can now interact with user.
+        - debugger can dump playfield.
+        - debugger can print information about current IP.
+        - debugger can execute a befunge program step by step.
+
 0.05  Sat Nov 30 11:31:25 CET 2002
         - new file debug.pasm that will handle all the debugging
           capabilities of the interpreter.
Index: README
===================================================================
RCS file: /cvs/public/parrot/languages/befunge/README,v
retrieving revision 1.5
diff -u -d -r1.5 README
--- README	30 Nov 2002 15:51:09 -0000	1.5
+++ README	1 Dec 2002 09:08:29 -0000
@@ -1,6 +1,6 @@
 DESCRIPTION
 -----------
-This is a Befunge interpreter written in Parrot assembler, version 0.05
+This is a Befunge interpreter written in Parrot assembler, version 0.06
 
 This interpreter should be Befunge-93 compliant. This means the
 playfield is limited to 80x25 and can hold *only bytes*. This means
Index: debug.pasm
===================================================================
RCS file: /cvs/public/parrot/languages/befunge/debug.pasm,v
retrieving revision 1.1
diff -u -d -r1.1 debug.pasm
--- debug.pasm	30 Nov 2002 15:53:38 -0000	1.1
+++ debug.pasm	1 Dec 2002 09:08:30 -0000
@@ -44,8 +44,69 @@
 # stop and interact with user.
 DEBUG_INTERACT:
         bsr DEBUG_PRINT_STATUS
+        print "bef> "
+        readline S10, 0
+        chopn S10, 1
+        length I10, S10
+        eq I10, 0, DEBUG_INTERACT_NEXT
+        substr S11, S10, 0, 4
+        eq S11, "dump", DEBUG_INTERACT_DUMP
+        eq S11, "help", DEBUG_INTERACT_HELP
+        eq S11, "list", DEBUG_INTERACT_LIST
+        eq S11, "next", DEBUG_INTERACT_NEXT
+        eq S11, "quit", DEBUG_INTERACT_QUIT
+        substr S11, S10, 0, 5
+        eq S11, "break", DEBUG_INTERACT_BREAK
+        substr S11, S10, 0, 6
+        eq S11, "status", DEBUG_INTERACT_STATUS
+        substr S11, S10, 0, 7
+        eq S11, "restart", DEBUG_INTERACT_RESTART
+        substr S11, S10, 0, 8
+        eq S11, "continue", DEBUG_INTERACT_CONTINUE
+        print "Unknown instruction. Type help for help.\n"
+        branch DEBUG_INTERACT
+DEBUG_INTERACT_BREAK:
+        print "Not yet implemented...\n"
+        branch DEBUG_INTERACT
+DEBUG_INTERACT_CONTINUE:
+        set P3[0], 0        # do not stop at next instruction
+        branch DEBUG_INTERACT_END
+DEBUG_INTERACT_DUMP:
+        bsr DEBUG_DUMP_PLAYFIELD
+        branch DEBUG_INTERACT
+DEBUG_INTERACT_HELP:
+        print "Available commands are:\n"
+        print " status        - print state of current IP\n"
+        print " dump          - dump playfield\n"
+        print " break char c  - set a breakpoint on character c\n"
+        print " break at x,y  - set a breakpoint at coords (x,y)\n"
+        print " list          - list breakpoints\n"
+        print " next          - step one befunge instruction\n"
+        print " continue      - resume execution\n"
+        print " restart       - restart execution\n"
+        print " quit          - abort execution\n"
+        print " help          - display this message\n"
+        print "\n"
+        branch DEBUG_INTERACT
+DEBUG_INTERACT_LIST:
+        print "Not yet implemented...\n"
+        branch DEBUG_INTERACT
+DEBUG_INTERACT_NEXT:
+        set P3[0], 1        # stop at next instruction
+        branch DEBUG_INTERACT_END
+DEBUG_INTERACT_QUIT:
+        end
+DEBUG_INTERACT_RESTART:
+        #branch MAIN
+        print "Not yet implemented...\n"
+        branch DEBUG_INTERACT
+DEBUG_INTERACT_STATUS:
+        bsr DEBUG_PRINT_STATUS
+        branch DEBUG_INTERACT
+DEBUG_INTERACT_END:     
         ret
 
+                
         
 # Print the status of the instruction pointer:
 # coordinates, current char, direction, flags and stack.

Reply via email to