Difference between revisions of "TMGIDE.m"
From VistApedia
(Added glossary link to Prompt~) |
|||
(One intermediate revision by one other user not shown) | |||
Line 10: | Line 10: | ||
;" | ;" | ||
;" 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~|Prompt]], like this: |
;" | ;" | ||
;" (^ to quit) IDE> | ;" (^ to quit) IDE> | ||
Line 24: | Line 24: | ||
;" | ;" | ||
;"------------------------------------------------------------ | ;"------------------------------------------------------------ | ||
− | ;"------------------------------------------------------------ | + | ;"------------------------------------------------------------ |
Line 30: | Line 30: | ||
set TMGScrWidth=70 | set TMGScrWidth=70 | ||
set TMGScrHeight=10 | set TMGScrHeight=10 | ||
− | + | set tpWatchLine="" | |
+ | |||
do SetGlobals^TMGTERM | do SetGlobals^TMGTERM | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
for i=1:1:80 write ! | for i=1:1:80 write ! | ||
write !,"Welcome to the TMG debugging environment",! | write !,"Welcome to the TMG debugging environment",! | ||
Line 47: | Line 39: | ||
set $ZTRAP="do ErrTrap^TMGTPSTP($ZPOS) break" | set $ZTRAP="do ErrTrap^TMGTPSTP($ZPOS) break" | ||
set $ZSTATUS="" | set $ZSTATUS="" | ||
− | + | ||
− | do Prompt | + | do [[Prompt~|Prompt]] |
Done | Done | ||
do ShutDown | do ShutDown | ||
Line 54: | Line 46: | ||
;"------------------------------------------------------------------- | ;"------------------------------------------------------------------- | ||
− | + | ||
− | Prompt | + | [[Prompt~|Prompt]] |
new Line | new Line | ||
+ | do INITKB^XGF("*") ;"set up keyboard input escape code processing | ||
+ | |||
+ | Ppt2 | ||
+ | ;"write !,"(^ to quit) IDE>" | ||
+ | ;"set Line=$$READ^XGF write ! | ||
+ | |||
read !,"(^ to quit) IDE>",Line,! | read !,"(^ to quit) IDE>",Line,! | ||
Line 67: | Line 65: | ||
xecute Line | xecute Line | ||
set $ZSTEP="" ;"turn off step capture | set $ZSTEP="" ;"turn off step capture | ||
− | goto | + | goto Ppt2 |
− | |||
+ | ;"------------------------------------------------------------------- | ||
+ | |||
ShutDown | ShutDown | ||
− | |||
do KillGlobals^TMGTERM | do KillGlobals^TMGTERM | ||
− | kill | + | |
− | kill | + | kill TMGScrWidth |
− | kill | + | kill TMGScrHeight |
− | kill | + | kill tpWatchLine |
− | + | kill ^TMP("TMGIDE",$J,"MODULES") | |
+ | do VTATRIB^TMGTERM(0) | ||
+ | do RESETKB^XGF ;"turn off XGF escape key processing code. | ||
+ | write "Leaving TMG debugging environment. Goodbye.",! | ||
quit | quit | ||
+ | |||
+ | ;"------------------------------------------------------------------- | ||
BKPT | BKPT | ||
Line 85: | Line 88: | ||
ZBREAK @Pos | ZBREAK @Pos | ||
write "ZBREAK ",Pos,! | write "ZBREAK ",Pos,! | ||
− | + | ||
quit | quit |
Latest revision as of 02:24, 4 March 2012
;"------------------------------------------------------------ ;"------------------------------------------------------------ ;" ;" 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 set TMGScrWidth=70 set TMGScrHeight=10 set tpWatchLine="" do SetGlobals^TMGTERM for i=1:1:80 write ! write !,"Welcome to the TMG debugging environment",! write "Enter any valid M command...",! set $ZTRAP="do ErrTrap^TMGTPSTP($ZPOS) break" set $ZSTATUS="" do Prompt Done do ShutDown quit ;"------------------------------------------------------------------- Prompt new Line do INITKB^XGF("*") ;"set up keyboard input escape code processing Ppt2 ;"write !,"(^ to quit) IDE>" ;"set Line=$$READ^XGF write ! read !,"(^ to quit) IDE>",Line,! if Line="^" set $ZSTEP="" quit set $ZSTEP="N TMGTrap S TMGTrap=$$STEPTRAP^TMGTPSTP($ZPOS) zstep:(TMGTrap=1) into zstep:(TMGTrap=2) over zcontinue" ;set $ZSTEP="do STEPTRAP^TMGTPSTP($ZPOS) zstep into zcontinue" set TMGRunMode=1 ;"1=Step-by-step mode zstep into xecute Line set $ZSTEP="" ;"turn off step capture goto Ppt2 ;"------------------------------------------------------------------- ShutDown do KillGlobals^TMGTERM kill TMGScrWidth kill TMGScrHeight kill tpWatchLine kill ^TMP("TMGIDE",$J,"MODULES") do VTATRIB^TMGTERM(0) do RESETKB^XGF ;"turn off XGF escape key processing code. write "Leaving TMG debugging environment. Goodbye.",! quit ;"------------------------------------------------------------------- BKPT read "Enter breakpoint (e.g. Label+8^MyFunct): ",Pos,! set Pos=Pos_":""n tmg s tmg=$$STEPTRAP^TMGTPSTP($ZPOS,1)""" ZBREAK @Pos write "ZBREAK ",Pos,! quit