J debugger 
Author Message
 J debugger

 I didn't know how to use the isi de{*filter*} until recently and
 it may be the case that other J programmers aren't using it.
 (ISI documentation only provides an example usage for 13!:3
 and I don't find the one word descriptions very mneumonic.)
 This is session demonstrates the usage with J 7.0.

   enable =. 13!:0
   where  =. 13!:1
   status =. 13!:2
   break  =. 13!:3
   step   =. 13!:4
   sic    =. 13!:6  NB. clears stack sic is an APL not GDB spelling
   continue =. 13!:7

   enable 1         NB.  The biggest trick is seeing that the
                    NB.  de{*filter*} must be enabled. If the de{*filter*} is
                    NB.  not enabled nothing happens. BTW, there is a quirk
                    NB.  in that "enable 0". sometimes doesn't disable it :)

   break 'shapes : 25 26 27 28'  NB. Set breaks at lines 25 26 27 and 28
                    NB.  notice the colon delimits  monadic and dyadic
                    NB.  line numbers. This breaks in the dyadic use
                    NB.  of shapes only. If the de{*filter*} doesn't seem
                    NB.  to be working you may have forgot a comma.

   4 shapes 1      NB.   Run a verb called shapes
      step ''       NB. step to next instruction
|   m=.m,(t=.t+/ .*k)  
      m;t;k        NB. examine m,t, and k
|5.72119e_18           1|5.72119e_18           1|5.72119e_18           1|
|         _1 5.72119e_18|         _1 5.72119e_18|         _1 5.72119e_18|
      step ''
|   sm1=.<:sm1  
      step ''
|   $.=.>(sm1>0){l1;l0  
      status ''    NB. Get list of break points
shapes : 25 26 27 28
      where ''  
|   $.=.>(sm1>0){l1;l0  
|   4   shapes 1

   There is a quirk in that if one attempts to load
   a  verb currently being debugged it won't
   be recognized in the interpreter. There is no
   warning message and it is easy to find that you
   are stepping through an old version of a verb.
   One gets around this by clearing the stack and toggeling
   the enable.

   It is forward to tie the instructions into emacs so,
   for example, one could type CNTL-* instead of typing "step ''".
   Similiarly, in J 8 there is a Tools facility allowing users
   to bind alt keys to J instructions. This feature could be
   used for defining keystrokes for the de{*filter*}.

   I found the de{*filter*} of emmense help in translating
   Langlet's APL into J.

   BTW, I haven't figured what 13!:5 does. Is not gdb's next.


Sat, 01 Feb 1997 14:40:43 GMT  
 [ 1 post ] 

 Relevant Pages 

1. JS-EAI with *JS*-callback

2. js.exception 3279.js

3. Debuggers, Static Debuggers, and Algebraic Steppers

4. using python debugger (pdb) inside emacs debugger mode ...

5. NB. gray.js: a J verb that generates a grayscale postscript image from a 2d array

6. lapackTest.js

7. profile.js

8. J script file profile.js

9. JS valueOf() in RB ?

10. JS for functional programming?

11. JS for functional programming?

12. prefs.js question


Powered by phpBB® Forum Software