Difference between revisions of "TMGIDE.m"

From VistApedia
Jump to: navigation, search
 
Line 1: Line 1:
;"------------------------------------------------------------
+
;"------------------------------------------------------------
;"------------------------------------------------------------
+
;"------------------------------------------------------------
;"
+
;"
;" GT.M Debug Tracer
+
;" GT.M Debug Tracer
;"
+
;"
;" K. Toppenberg
+
;" K. Toppenberg
;" 4-13-2005
+
;" 4-13-2005
;" License: GPL Applies
+
;" License: GPL Applies
;"
+
;"
;"
+
;"
;" This program will launch a shell for the TMG STEP TRAP debugger
+
;" This program will launch a shell for the TMG STEP TRAP debugger
;" It provides the user with a prompt, like this:
+
;" It provides the user with a prompt, like this:
;"
+
;"
;"      (^ to quit) IDE>
+
;"      (^ to quit) IDE>
;"
+
;"
;" Any valid M code may be entered here.  To use the tracing
+
;" Any valid M code may be entered here.  To use the tracing
;" ability, launch a function, like this:
+
;" ability, launch a function, like this:
;"
+
;"
;"      (^ to quit) IDE>do ^MyFunction
+
;"      (^ to quit) IDE>do ^MyFunction
;"
+
;"
;"
+
;"
;" Dependancies:
+
;" Dependancies:
;"    Uses TMGTRSTP,TMGTERM
+
;"    Uses TMGTRSTP,TMGTERM
;"
+
;"
;"------------------------------------------------------------
+
;"------------------------------------------------------------
;"------------------------------------------------------------
+
;"------------------------------------------------------------
 +
 
 
   
 
   
 
+
Start
Start
 
 
         new ScrHeight set ScrHeight=10 ;"defined in ShowCode also
 
         new ScrHeight set ScrHeight=10 ;"defined in ShowCode also
 
         new ScrWidth set ScrWidth=70  ;"defined in ShowCode also
 
         new ScrWidth set ScrWidth=70  ;"defined in ShowCode also
 
+
 
         set ^TMP("TMGIDE",$J,"ScrWidth")=ScrWidth
 
         set ^TMP("TMGIDE",$J,"ScrWidth")=ScrWidth
 
         set ^TMP("TMGIDE",$J,"ScrHeight")=ScrHeight
 
         set ^TMP("TMGIDE",$J,"ScrHeight")=ScrHeight
 
+
 
         do SetGlobals^TMGTERM
 
         do SetGlobals^TMGTERM
 
         set ^TMP("TMGIDE",$J,"Normal Foreground Color")=TMGcYellow
 
         set ^TMP("TMGIDE",$J,"Normal Foreground Color")=TMGcYellow
Line 39: Line 39:
 
         set ^TMP("TMGIDE",$J,"Debug Foreground Color")=TMGcBlack
 
         set ^TMP("TMGIDE",$J,"Debug Foreground Color")=TMGcBlack
 
         set ^TMP("TMGIDE",$J,"Debug Background Color")=TMGcWhite
 
         set ^TMP("TMGIDE",$J,"Debug Background Color")=TMGcWhite
 
+
 
         ;"write #  ;"formfeed
 
         ;"write #  ;"formfeed
 
         ;"do CUP^TMGTERM(1,ScrHeight+1)
 
         ;"do CUP^TMGTERM(1,ScrHeight+1)
Line 47: Line 47:
 
         set $ZTRAP="write !,""This is a ZTRAP line"",! break"
 
         set $ZTRAP="write !,""This is a ZTRAP line"",! break"
 
         set $ZSTATUS=""
 
         set $ZSTATUS=""
 
+
 
         ;"Run modes: 0=fast mode  1=slow mode 2=Don't show code
 
         ;"Run modes: 0=fast mode  1=slow mode 2=Don't show code
 
         set ^TMP("TMGIDE",$J,"Run Mode")=0
 
         set ^TMP("TMGIDE",$J,"Run Mode")=0
 
         new BlankLine set BlankLine=" "
 
         new BlankLine set BlankLine=" "
 
         for i=1:1:ScrWidth-1 set BlankLine=BlankLine_" "
 
         for i=1:1:ScrWidth-1 set BlankLine=BlankLine_" "
 
+
 
         do Prompt
 
         do Prompt
Done
+
Done
 
         do ShutDown
 
         do ShutDown
 
         quit
 
         quit
 
+
;"-------------------------------------------------------------------
+
;"-------------------------------------------------------------------
 
+
Prompt
+
Prompt
 
         new Line
 
         new Line
 
         write !,BlankLine,!
 
         write !,BlankLine,!
 
         do CUU^TMGTERM(1)
 
         do CUU^TMGTERM(1)
 
         read "(^ to quit) IDE>",Line
 
         read "(^ to quit) IDE>",Line
 
+
 
         if Line="^" set $ZSTEP="" quit
 
         if Line="^" set $ZSTEP="" quit
 
         set $ZSTEP="do STEPTRAP^TMGTRSTP($ZPOS) zstep into zcontinue"
 
         set $ZSTEP="do STEPTRAP^TMGTRSTP($ZPOS) zstep into zcontinue"
Line 72: Line 72:
 
         set $ZSTEP=""  ;"turn off step capture
 
         set $ZSTEP=""  ;"turn off step capture
 
         goto Prompt
 
         goto Prompt
 
+
ShutDown
+
ShutDown
 
         ;"do ShowCode("",1)
 
         ;"do ShowCode("",1)
 
         kill ^TMP("TMGIDE",$J)
 
         kill ^TMP("TMGIDE",$J)
 
         do KillGlobals^TMGTERM
 
         do KillGlobals^TMGTERM
 
         quit
 
         quit

Revision as of 22:12, 14 April 2005

;"------------------------------------------------------------
;"------------------------------------------------------------
;"
;" GT.M Debug Tracer
;"
;" K. Toppenberg
;" 4-13-2005
;" License: GPL Applies
;"
;"
;" This program will launch a shell for the TMG STEP TRAP debugger
;" It provides the user with a prompt, like this:
;"
;"      (^ to quit) IDE>
;"
;" Any valid M code may be entered here.  To use the tracing
;" ability, launch a function, like this:
;"
;"      (^ to quit) IDE>do ^MyFunction
;"
;"
;" Dependancies:
;"     Uses TMGTRSTP,TMGTERM
;"
;"------------------------------------------------------------
;"------------------------------------------------------------
 

Start
       new ScrHeight set ScrHeight=10 ;"defined in ShowCode also
       new ScrWidth set ScrWidth=70   ;"defined in ShowCode also

       set ^TMP("TMGIDE",$J,"ScrWidth")=ScrWidth
       set ^TMP("TMGIDE",$J,"ScrHeight")=ScrHeight

       do SetGlobals^TMGTERM
       set ^TMP("TMGIDE",$J,"Normal Foreground Color")=TMGcYellow
       set ^TMP("TMGIDE",$J,"Normal Background Color")=TMGcBlack
       set ^TMP("TMGIDE",$J,"Debug Foreground Color")=TMGcBlack
       set ^TMP("TMGIDE",$J,"Debug Background Color")=TMGcWhite

       ;"write #  ;"formfeed
       ;"do CUP^TMGTERM(1,ScrHeight+1)
       for i=1:1:80 write !
       write !,"Welcome to the TMG debugging environment",!
       write "Enter any valid M command...",!
       set $ZTRAP="write !,""This is a ZTRAP line"",! break"
       set $ZSTATUS=""

       ;"Run modes: 0=fast mode  1=slow mode 2=Don't show code
       set ^TMP("TMGIDE",$J,"Run Mode")=0
       new BlankLine set BlankLine=" "
       for i=1:1:ScrWidth-1 set BlankLine=BlankLine_" "

       do Prompt
Done
       do ShutDown
       quit

;"-------------------------------------------------------------------

Prompt
       new Line
       write !,BlankLine,!
       do CUU^TMGTERM(1)
       read "(^ to quit) IDE>",Line

       if Line="^" set $ZSTEP="" quit
       set $ZSTEP="do STEPTRAP^TMGTRSTP($ZPOS) zstep into zcontinue"
       zstep into
       xecute Line
       set $ZSTEP=""  ;"turn off step capture
       goto Prompt

ShutDown
       ;"do ShowCode("",1)
       kill ^TMP("TMGIDE",$J)
       do KillGlobals^TMGTERM
       quit