home *** CD-ROM | disk | FTP | other *** search
- /*H* RDDEMO.KEX 01-30-93 10:45*/
- arg dborigin parms
- arg panel misc
- Signal On Error; Signal On Failure; Signal On Halt
- Signal On Novalue; Signal On Notready; Signal ON Syntax
- me='RDDEMO'
- dbme=me
- dbtrc=0
- dbc='COMMAND'
- parse value dbc 'SET!'dbc 'X!'dbc 'EXT!'dbc 'SOS' With dbcs'!'dbxx'!'dbce'!'dbso
- dbce '/OPSYS'
- dbme='rddemo'
- dbsys=opsys.1
- if dbsys='OS/2' then dbsys='OS2' /*O*/
- Parse Value 0 With dbtrc dbtrap dbtrapp dbmsg dbstr
- if dborigin='' then panel='FINIS'
- if dborigin='?' then /* Exit */ Return tell(me)
- list='WELCOME PROFILE SOURCE LOG'
- answer=''
- else do
- box=db3box(panel)
- if left(box,4)='BOX.' then do
- 'EMSG' rdbmsg(111 panel)
- return 0; end
- call dialog
- end
- /* Exit */ Return answer
-
- DB3BOX:
- arg box
- lf = d2c(10)
- signal value(box)
- DIALOG:
- parse var box code1 action1 '!' code2 action2 '!' object statement
- if object = "DIALOG" then do
- dbce '/VERSION'
- if version.2 >= 5.00 then do
- if code1='M' then call rdbmenu action1
- object statement
- if dialog.2="OK" then do
- answer='Nop';
- if code2='P' then address command 'PRESS' action2
- if code2='R' then answer=action2; end
- else answer="dbstr='EXIT'"
- End
- else do
-
- 'EMSG' prompt
- parse value 'NO' with panel2 code
- parse value rdbui(1) with statement
- if statement<>'' then panel2='OK'; */
- end
- end
- return answer
-
- WELCOME:
- s = " Welcome to rDEBUG"lf
- s = s lf
- s = s "The Integrated Debugger for REXX"lf
- s = s lf
- s = s "This Demo is completely automated "lf
- s = s "and requires only that you press "lf
- s = s "ENTER to continue or select CANCEL "lf
- s = s "to terminate this demo. Relax, I will"lf
- s = s "make all selections for you. "lf
- return ,
- 'x x! x x !',
- "DIALOG /" s "/ TITLE /rDEBUG Demo/ OKCANCEL"
-
- LOG:
- s = " SESSION LOG"lf
- s = s lf
- s = s "This is the previous SESSION LOG "lf
- s = s "which may be used to recreate "lf
- s = s "the last session. You may make any "lf
- s = s "changes to it, just enter S (to "lf
- s = s "SAVE it) then C (to continue), "lf
- s = s "Note, press F2 to switch to menu "lf
- s = s "mode from data mode and vice versa "lf
- s = s "I will enter S and C (to Save and "lf
- s = s "Continue). "lf
- return ,
- 'M * 2 7 ! R dbstr = DONE !',
- "DIALOG /" s "/ TITLE /rDEBUG Demo/ OKCANCEL"
-
- PROFILE:
- s = " YOUR PROFILE"lf
- s = s lf
- s = s "This screen shows the previous "lf
- s = s "profile. Here you would make any "lf
- s = s "changes to it if you wish to set "lf
- s = s "various switches, variables and "lf
- s = s "prefix commands. I will enter N "lf
- s = s "(for new default profile). "lf
-
- return ,
- 'M . 3 6 ! R dbstr = NEW !',
- "DIALOG /" s "/ TITLE /rDEBUG Demo/ OKCANCEL"
-
- SOURCE:
- s = " SOURCE PROGRAM or MACRO"lf
- s = s lf
- s = s "This screen shows your source file "lf
- s = s "and appears only if rDEBUG was "lf
- s = s "unable to find your file or it "lf
- s = s "contains certain errors like "lf
- s = s "unmatched delimiters or has a "lf
- s = s "'Procedure' statement. . Here you "lf
- s = s "would make any last-minute changes "lf
- s = s "to the source file, if you wish. "lf
- s = s "Do so and enter D (DONE to "lf
- s = s "continue). I will enter D. "lf
-
- return ,
- 'M . 4 4 ! R dbstr = "DONE" !',
- "DIALOG /" s "/ TITLE /rDEBUG Demo/ OKCANCEL"
-
- WELCOME2:
- s = " Let's get to work"lf
- s = s lf
- s = s "This is the main section of rDEBUG. "lf
- s = s "I will exercise some features of rDEBUG "lf
- s = s "and later we will examine how they went."lf
- s = s "Remember, that these commands can be "lf
- s = s "entered from the menus also. "lf
- s = s "First, we will show how to set "lf
- s = s "breakpoints. "lf
-
- return ,
- '. . . . ! R dbstr = "BREAK 2 5-7" !',
- "DIALOG /" s "/ TITLE /rDEBUG Demo/ OKCANCEL"
-
- BREAKPOINTS:
- s = " Breakpoints"lf
- s = s lf
- s = s "Notice, there is a BREAK at "lf
- s = s "line 2 and a range of BREAKs "lf
- s = s "on lines 5 through 7. When the"lf
- s = s "program reaches these lines "lf
- s = s "they will cause a halt in "lf
- s = s "execution. Next, we will set "lf
- s = s "a value to a variable. "lf
- return ,
- 'x x! R dbstr="abc = 1" !',
- "DIALOG /" s "/ TITLE /rDEBUG Demo/ OKCANCEL"
-
- ASSIGN:
- s = " Assignments "lf
- s = s "Caution: avoid redefining "lf
- s = s "rDEBUG variables (they start "lf
- s = s "with 'db'). Next, we will see"lf
- s = s "what the new value is. "lf
- return ,
- 'x x ! R dbstr="SAY abc def dbp"!',
- "DIALOG /" s "/ TITLE /rDEBUG Demo/ OKCANCEL"
-
- SHOW:
- s = " Show variables "lf
- s = s lf
- s = s "Notice, that the second "lf
- s = s "variable is in uppercase, this"lf
- s = s "is because it has not been "lf
- s = s "defined yet. The third "lf
- s = s "variable is a rDEBUG one (it "lf
- s = s "starts with 'db'). Next, we "lf
- s = s "will change the flow of "lf
- s = s "execution. "lf
- return ,
- 'x x ! R dbstr="GO 7" !',
- "DIALOG /" s "/ TITLE /rDEBUG Demo/ OKCANCEL"
-
- GO:
- s = " GO COMMAND"lf
- s = s lf
- s = s "You may GO to any line that "lf
- s = s "has a ':no', where no is a "lf
- s = s "line number. GO or F5 may be"lf
- s = s "used to continue to the next "lf
- s = s "line. Next, we will set some"lf
- s = s "watchpoints. "lf
- return ,
- 'x x ! R dbstr="watch abc (def>12)" !',
- "DIALOG /" s "/ TITLE /rDEBUG Demo/ OKCANCEL"
-
- WATCH:
- s = " WATCH COMMAND"lf
- s = s lf
- s = s "The first watch is a simple"lf
- s = s "one that generates a"lf
- s = s "breakpoint when it changes"lf
- s = s "value, the second; triggers"lf
- s = s "a halt whenever the expression"lf
- s = s "evaluates as true. You may"lf
- s = s "use SHIFT+F3 also. Next, we"lf
- s = s "will show how to single step."lf
- return ,
- 'x x ! R dbstr="GO 0" !',
- "DIALOG /" s "/ TITLE /rDEBUG Demo/ OKCANCEL"
-
- PROCEDURE:
- s = " STEP PROCEDURE COMMAND"lf
- s = s lf
- s = s "You may also use F10 (Procedure"lf
- s = s "Step Command) to step through"lf
- s = s "procedures. "lf
- s = s "Next we will run the profiler"lf
- s = s "tool to check the number of "lf
- s = s "times each instruction line "lf
- s = s "was executed. "lf
- return ,
- 'x x ! R dbstr="PROFILER " !',
- "DIALOG /" s "/ TITLE /rDEBUG Demo/ OKCANCEL"
-
- PROFILER:
- s = " PROFILER TOOL COMMAND "lf
- s = s lf
- s = s " Notice, the lines at 2-6 were not run."lf
- s = s " However, line 7 was run but not "lf
- s = s " recorded as such since we jumped to "lf
- s = s " :7 directly. Next we will terminate"lf
- s = s " this file. "lf
- return ,
- '. . . . ! R dbstr = "QQUIT" !',
- "DIALOG /" s "/ TITLE /rDEBUG Demo/ OKCANCEL"
-
- FINIS:
- s = " EXIT COMMAND"lf
- s = s lf
- s = s " There you have it, a short demo. "lf
- s = s " Good luck! "lf
- return ,
- '. . . . ! R dbstr = "EXIT" !',
- "DIALOG /" s "/ TITLE /rDEBUG Demo/ OKCANCEL"
-
- ERROR: return db9trap(sigl 80e) sourceline(sigl)
- FAILURE: return db9trap(sigl 80f) sourceline(sigl)
- HALT: return db9trap(sigl 80h)
- NOTREADY: return db9trap(sigl 80r) sourceline(sigl)
- NOVALUE: return db9trap(sigl 80v)
- SYNTAX: return db9trap(sigl 80e) errortext(rc)'~'sourceline(sigl)
- db9TRAP:
- if dbtrc=-7 then dbtrapp=dbtrap
- parse arg dbsigl dbtcode dbtrest
- dbtrap = 0 dbme dbsigl dbtcode dbmsg rdbmsg(dbtcode dbme dbsigl) dbtrest
- dbtrc=-7
- return -7 dbtrapp'~'dbtrap
-