Home » CEEFAX disks » telesoftware15.adl » 06-05-89/PROBE_SYS
06-05-89/PROBE_SYS
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » CEEFAX disks » telesoftware15.adl |
Filename: | 06-05-89/PROBE_SYS |
Read OK: | ✔ |
File size: | 0B1A bytes |
Load address: | 0000 |
Exec address: | FFFFFFFF |
File contents
!The Probe debugger allows you to step through your compiled Pascal !program at the source line level. This allows the exact flow of !control to be monitored far more precisely than using diagnostic !write statements, but without being as incompehensible as a machine !level debugger. Probe also integrates with machine-level debuggers, !so that you can go right down to the machine code level if you !want to. To illustrate the power of Probe, we will step through !some of the SINEDEMO program. We do this using the STEP command. ! STEP ! !Probe has executed the first line of the program, which called the !PASPC procedure 'initscreen' (this initialises the screen and works !out what adaptor is present etc). ! !You will notice that the next command to be executed (see above) is !a CASE statement on the type of adaptor. So, if we step through this !command as well, we should find out what adaptor is present : ! STEP ! !We can list the source lines around the one just executed using the !LIST command. ! LIST LIST ! !It seems to be just initialization, so lets skip to line 246, where !something is output. ! GO 246 ! !ClrScr clears the screen by calling the appropriate BIOS function. !Lets assume we suspect that something is wrong with the 'doplot' !procedure. We can put in a breakpoint on this procedure by entering... ! BREAK doplot: ! !Now we can continue excution until that breakpoint !is reached by using GO ! GO ! !We can check how this procedure was entered by asking PROBE to !display a list of the last ten statements executed ... ! ROUTE ! !We can also check on what values any local variables have... ! DISPLAY ! !They look about right, so let's remove our breakpoint and skip !back to the main program ... ! B- ! Go sinedemo: ! !... and round the next procedure call ! GO sinedemo: ! !Now we can execute some of the loop. We'll put a breakpoint when i !gets bigger than 20 ! B i>20 G ! !If we go again, i will still be checked against 20 next time it changes ! G ! !So we'd better remove that breakpoint. ! B- ! !We can also use the PROFILE option to keep count of how many times !each line is executed. We'll set a breakpoint at the end of the !program so we can examine these counts. ! PROFILE G 261 ! !Now if we use the list command, the execution counts are displayed !beside each line. ! LIST 250..261 ! !Note we only started counting when we selected the P option. !That more or less wraps up the demo. Two other very useful commands !remain to be described (plus a few more esoteric ones). ! !Firstly, the help command - you can get general help ... ! HELP ! !... or more specific help. ! HELP TRACE ! !And lastly, the QUIT command. This is the one Probe command which !cannot be abbreviated. ! QUIT
00000000 21 54 68 65 20 50 72 6f 62 65 20 64 65 62 75 67 |!The Probe debug| 00000010 67 65 72 20 61 6c 6c 6f 77 73 20 79 6f 75 20 74 |ger allows you t| 00000020 6f 20 73 74 65 70 20 74 68 72 6f 75 67 68 20 79 |o step through y| 00000030 6f 75 72 20 63 6f 6d 70 69 6c 65 64 20 50 61 73 |our compiled Pas| 00000040 63 61 6c 0d 0a 21 70 72 6f 67 72 61 6d 20 61 74 |cal..!program at| 00000050 20 74 68 65 20 73 6f 75 72 63 65 20 6c 69 6e 65 | the source line| 00000060 20 6c 65 76 65 6c 2e 20 54 68 69 73 20 61 6c 6c | level. This all| 00000070 6f 77 73 20 74 68 65 20 65 78 61 63 74 20 66 6c |ows the exact fl| 00000080 6f 77 20 6f 66 0d 0a 21 63 6f 6e 74 72 6f 6c 20 |ow of..!control | 00000090 74 6f 20 62 65 20 6d 6f 6e 69 74 6f 72 65 64 20 |to be monitored | 000000a0 66 61 72 20 6d 6f 72 65 20 70 72 65 63 69 73 65 |far more precise| 000000b0 6c 79 20 74 68 61 6e 20 75 73 69 6e 67 20 64 69 |ly than using di| 000000c0 61 67 6e 6f 73 74 69 63 0d 0a 21 77 72 69 74 65 |agnostic..!write| 000000d0 20 73 74 61 74 65 6d 65 6e 74 73 2c 20 62 75 74 | statements, but| 000000e0 20 77 69 74 68 6f 75 74 20 62 65 69 6e 67 20 61 | without being a| 000000f0 73 20 69 6e 63 6f 6d 70 65 68 65 6e 73 69 62 6c |s incompehensibl| 00000100 65 20 61 73 20 61 20 6d 61 63 68 69 6e 65 0d 0a |e as a machine..| 00000110 21 6c 65 76 65 6c 20 64 65 62 75 67 67 65 72 2e |!level debugger.| 00000120 20 50 72 6f 62 65 20 61 6c 73 6f 20 69 6e 74 65 | Probe also inte| 00000130 67 72 61 74 65 73 20 77 69 74 68 20 6d 61 63 68 |grates with mach| 00000140 69 6e 65 2d 6c 65 76 65 6c 20 64 65 62 75 67 67 |ine-level debugg| 00000150 65 72 73 2c 0d 0a 21 73 6f 20 74 68 61 74 20 79 |ers,..!so that y| 00000160 6f 75 20 63 61 6e 20 67 6f 20 72 69 67 68 74 20 |ou can go right | 00000170 64 6f 77 6e 20 74 6f 20 74 68 65 20 6d 61 63 68 |down to the mach| 00000180 69 6e 65 20 63 6f 64 65 20 6c 65 76 65 6c 20 69 |ine code level i| 00000190 66 20 79 6f 75 0d 0a 21 77 61 6e 74 20 74 6f 2e |f you..!want to.| 000001a0 20 54 6f 20 69 6c 6c 75 73 74 72 61 74 65 20 74 | To illustrate t| 000001b0 68 65 20 70 6f 77 65 72 20 6f 66 20 50 72 6f 62 |he power of Prob| 000001c0 65 2c 20 77 65 20 77 69 6c 6c 20 73 74 65 70 20 |e, we will step | 000001d0 74 68 72 6f 75 67 68 0d 0a 21 73 6f 6d 65 20 6f |through..!some o| 000001e0 66 20 74 68 65 20 53 49 4e 45 44 45 4d 4f 20 70 |f the SINEDEMO p| 000001f0 72 6f 67 72 61 6d 2e 20 57 65 20 64 6f 20 74 68 |rogram. We do th| 00000200 69 73 20 75 73 69 6e 67 20 74 68 65 20 53 54 45 |is using the STE| 00000210 50 20 63 6f 6d 6d 61 6e 64 2e 0d 0a 21 0d 0a 53 |P command...!..S| 00000220 54 45 50 0d 0a 21 0d 0a 21 50 72 6f 62 65 20 68 |TEP..!..!Probe h| 00000230 61 73 20 65 78 65 63 75 74 65 64 20 74 68 65 20 |as executed the | 00000240 66 69 72 73 74 20 6c 69 6e 65 20 6f 66 20 74 68 |first line of th| 00000250 65 20 70 72 6f 67 72 61 6d 2c 20 77 68 69 63 68 |e program, which| 00000260 20 63 61 6c 6c 65 64 20 74 68 65 0d 0a 21 50 41 | called the..!PA| 00000270 53 50 43 20 70 72 6f 63 65 64 75 72 65 20 27 69 |SPC procedure 'i| 00000280 6e 69 74 73 63 72 65 65 6e 27 20 28 74 68 69 73 |nitscreen' (this| 00000290 20 69 6e 69 74 69 61 6c 69 73 65 73 20 74 68 65 | initialises the| 000002a0 20 73 63 72 65 65 6e 20 61 6e 64 20 77 6f 72 6b | screen and work| 000002b0 73 0d 0a 21 6f 75 74 20 77 68 61 74 20 61 64 61 |s..!out what ada| 000002c0 70 74 6f 72 20 69 73 20 70 72 65 73 65 6e 74 20 |ptor is present | 000002d0 65 74 63 29 2e 20 0d 0a 21 0d 0a 21 59 6f 75 20 |etc). ..!..!You | 000002e0 77 69 6c 6c 20 6e 6f 74 69 63 65 20 74 68 61 74 |will notice that| 000002f0 20 74 68 65 20 6e 65 78 74 20 63 6f 6d 6d 61 6e | the next comman| 00000300 64 20 74 6f 20 62 65 20 65 78 65 63 75 74 65 64 |d to be executed| 00000310 20 28 73 65 65 20 61 62 6f 76 65 29 20 69 73 0d | (see above) is.| 00000320 0a 21 61 20 43 41 53 45 20 73 74 61 74 65 6d 65 |.!a CASE stateme| 00000330 6e 74 20 6f 6e 20 74 68 65 20 74 79 70 65 20 6f |nt on the type o| 00000340 66 20 61 64 61 70 74 6f 72 2e 20 53 6f 2c 20 69 |f adaptor. So, i| 00000350 66 20 77 65 20 73 74 65 70 20 74 68 72 6f 75 67 |f we step throug| 00000360 68 20 74 68 69 73 0d 0a 21 63 6f 6d 6d 61 6e 64 |h this..!command| 00000370 20 61 73 20 77 65 6c 6c 2c 20 77 65 20 73 68 6f | as well, we sho| 00000380 75 6c 64 20 66 69 6e 64 20 6f 75 74 20 77 68 61 |uld find out wha| 00000390 74 20 61 64 61 70 74 6f 72 20 69 73 20 70 72 65 |t adaptor is pre| 000003a0 73 65 6e 74 20 3a 0d 0a 21 0d 0a 53 54 45 50 0d |sent :..!..STEP.| 000003b0 0a 21 0d 0a 21 57 65 20 63 61 6e 20 6c 69 73 74 |.!..!We can list| 000003c0 20 74 68 65 20 73 6f 75 72 63 65 20 6c 69 6e 65 | the source line| 000003d0 73 20 61 72 6f 75 6e 64 20 74 68 65 20 6f 6e 65 |s around the one| 000003e0 20 6a 75 73 74 20 65 78 65 63 75 74 65 64 20 75 | just executed u| 000003f0 73 69 6e 67 20 74 68 65 0d 0a 21 4c 49 53 54 20 |sing the..!LIST | 00000400 63 6f 6d 6d 61 6e 64 2e 0d 0a 21 0d 0a 4c 49 53 |command...!..LIS| 00000410 54 0d 0a 4c 49 53 54 0d 0a 21 0d 0a 21 49 74 20 |T..LIST..!..!It | 00000420 73 65 65 6d 73 20 74 6f 20 62 65 20 6a 75 73 74 |seems to be just| 00000430 20 69 6e 69 74 69 61 6c 69 7a 61 74 69 6f 6e 2c | initialization,| 00000440 20 73 6f 20 6c 65 74 73 20 73 6b 69 70 20 74 6f | so lets skip to| 00000450 20 6c 69 6e 65 20 32 34 36 2c 20 77 68 65 72 65 | line 246, where| 00000460 0d 0a 21 73 6f 6d 65 74 68 69 6e 67 20 69 73 20 |..!something is | 00000470 6f 75 74 70 75 74 2e 0d 0a 21 0d 0a 47 4f 20 32 |output...!..GO 2| 00000480 34 36 0d 0a 21 0d 0a 21 43 6c 72 53 63 72 20 63 |46..!..!ClrScr c| 00000490 6c 65 61 72 73 20 74 68 65 20 73 63 72 65 65 6e |lears the screen| 000004a0 20 62 79 20 63 61 6c 6c 69 6e 67 20 74 68 65 20 | by calling the | 000004b0 61 70 70 72 6f 70 72 69 61 74 65 20 42 49 4f 53 |appropriate BIOS| 000004c0 20 66 75 6e 63 74 69 6f 6e 2e 0d 0a 21 4c 65 74 | function...!Let| 000004d0 73 20 61 73 73 75 6d 65 20 77 65 20 73 75 73 70 |s assume we susp| 000004e0 65 63 74 20 74 68 61 74 20 73 6f 6d 65 74 68 69 |ect that somethi| 000004f0 6e 67 20 69 73 20 77 72 6f 6e 67 20 77 69 74 68 |ng is wrong with| 00000500 20 74 68 65 20 27 64 6f 70 6c 6f 74 27 20 0d 0a | the 'doplot' ..| 00000510 21 70 72 6f 63 65 64 75 72 65 2e 20 57 65 20 63 |!procedure. We c| 00000520 61 6e 20 70 75 74 20 69 6e 20 61 20 62 72 65 61 |an put in a brea| 00000530 6b 70 6f 69 6e 74 20 6f 6e 20 74 68 69 73 20 70 |kpoint on this p| 00000540 72 6f 63 65 64 75 72 65 20 62 79 20 65 6e 74 65 |rocedure by ente| 00000550 72 69 6e 67 2e 2e 2e 0d 0a 21 0d 0a 42 52 45 41 |ring.....!..BREA| 00000560 4b 20 64 6f 70 6c 6f 74 3a 0d 0a 21 0d 0a 21 4e |K doplot:..!..!N| 00000570 6f 77 20 77 65 20 63 61 6e 20 63 6f 6e 74 69 6e |ow we can contin| 00000580 75 65 20 65 78 63 75 74 69 6f 6e 20 75 6e 74 69 |ue excution unti| 00000590 6c 20 74 68 61 74 20 62 72 65 61 6b 70 6f 69 6e |l that breakpoin| 000005a0 74 20 0d 0a 21 69 73 20 72 65 61 63 68 65 64 20 |t ..!is reached | 000005b0 62 79 20 75 73 69 6e 67 20 47 4f 0d 0a 21 0d 0a |by using GO..!..| 000005c0 47 4f 0d 0a 21 0d 0a 21 57 65 20 63 61 6e 20 63 |GO..!..!We can c| 000005d0 68 65 63 6b 20 68 6f 77 20 74 68 69 73 20 70 72 |heck how this pr| 000005e0 6f 63 65 64 75 72 65 20 77 61 73 20 65 6e 74 65 |ocedure was ente| 000005f0 72 65 64 20 62 79 20 61 73 6b 69 6e 67 20 50 52 |red by asking PR| 00000600 4f 42 45 20 74 6f 0d 0a 21 64 69 73 70 6c 61 79 |OBE to..!display| 00000610 20 61 20 6c 69 73 74 20 6f 66 20 74 68 65 20 6c | a list of the l| 00000620 61 73 74 20 74 65 6e 20 73 74 61 74 65 6d 65 6e |ast ten statemen| 00000630 74 73 20 65 78 65 63 75 74 65 64 20 2e 2e 2e 0d |ts executed ....| 00000640 0a 21 0d 0a 52 4f 55 54 45 0d 0a 21 0d 0a 21 57 |.!..ROUTE..!..!W| 00000650 65 20 63 61 6e 20 61 6c 73 6f 20 63 68 65 63 6b |e can also check| 00000660 20 6f 6e 20 77 68 61 74 20 76 61 6c 75 65 73 20 | on what values | 00000670 61 6e 79 20 6c 6f 63 61 6c 20 76 61 72 69 61 62 |any local variab| 00000680 6c 65 73 20 68 61 76 65 2e 2e 2e 0d 0a 21 0d 0a |les have.....!..| 00000690 44 49 53 50 4c 41 59 0d 0a 21 0d 0a 21 54 68 65 |DISPLAY..!..!The| 000006a0 79 20 6c 6f 6f 6b 20 61 62 6f 75 74 20 72 69 67 |y look about rig| 000006b0 68 74 2c 20 73 6f 20 6c 65 74 27 73 20 72 65 6d |ht, so let's rem| 000006c0 6f 76 65 20 6f 75 72 20 62 72 65 61 6b 70 6f 69 |ove our breakpoi| 000006d0 6e 74 20 61 6e 64 20 73 6b 69 70 0d 0a 21 62 61 |nt and skip..!ba| 000006e0 63 6b 20 74 6f 20 74 68 65 20 6d 61 69 6e 20 70 |ck to the main p| 000006f0 72 6f 67 72 61 6d 20 2e 2e 2e 0d 0a 21 0d 0a 42 |rogram .....!..B| 00000700 2d 0d 0a 21 0d 0a 47 6f 20 73 69 6e 65 64 65 6d |-..!..Go sinedem| 00000710 6f 3a 0d 0a 21 0d 0a 21 2e 2e 2e 20 61 6e 64 20 |o:..!..!... and | 00000720 72 6f 75 6e 64 20 74 68 65 20 6e 65 78 74 20 70 |round the next p| 00000730 72 6f 63 65 64 75 72 65 20 63 61 6c 6c 0d 0a 21 |rocedure call..!| 00000740 0d 0a 47 4f 20 73 69 6e 65 64 65 6d 6f 3a 0d 0a |..GO sinedemo:..| 00000750 21 0d 0a 21 4e 6f 77 20 77 65 20 63 61 6e 20 65 |!..!Now we can e| 00000760 78 65 63 75 74 65 20 73 6f 6d 65 20 6f 66 20 74 |xecute some of t| 00000770 68 65 20 6c 6f 6f 70 2e 20 57 65 27 6c 6c 20 70 |he loop. We'll p| 00000780 75 74 20 61 20 62 72 65 61 6b 70 6f 69 6e 74 20 |ut a breakpoint | 00000790 77 68 65 6e 20 69 0d 0a 21 67 65 74 73 20 62 69 |when i..!gets bi| 000007a0 67 67 65 72 20 74 68 61 6e 20 32 30 0d 0a 21 0d |gger than 20..!.| 000007b0 0a 42 20 69 3e 32 30 0d 0a 47 0d 0a 21 0d 0a 21 |.B i>20..G..!..!| 000007c0 49 66 20 77 65 20 67 6f 20 61 67 61 69 6e 2c 20 |If we go again, | 000007d0 69 20 77 69 6c 6c 20 73 74 69 6c 6c 20 62 65 20 |i will still be | 000007e0 63 68 65 63 6b 65 64 20 61 67 61 69 6e 73 74 20 |checked against | 000007f0 32 30 20 6e 65 78 74 20 74 69 6d 65 20 69 74 20 |20 next time it | 00000800 63 68 61 6e 67 65 73 0d 0a 21 0d 0a 47 0d 0a 21 |changes..!..G..!| 00000810 0d 0a 21 53 6f 20 77 65 27 64 20 62 65 74 74 65 |..!So we'd bette| 00000820 72 20 72 65 6d 6f 76 65 20 74 68 61 74 20 62 72 |r remove that br| 00000830 65 61 6b 70 6f 69 6e 74 2e 0d 0a 21 0d 0a 42 2d |eakpoint...!..B-| 00000840 0d 0a 21 0d 0a 21 57 65 20 63 61 6e 20 61 6c 73 |..!..!We can als| 00000850 6f 20 75 73 65 20 74 68 65 20 50 52 4f 46 49 4c |o use the PROFIL| 00000860 45 20 6f 70 74 69 6f 6e 20 74 6f 20 6b 65 65 70 |E option to keep| 00000870 20 63 6f 75 6e 74 20 6f 66 20 68 6f 77 20 6d 61 | count of how ma| 00000880 6e 79 20 74 69 6d 65 73 0d 0a 21 65 61 63 68 20 |ny times..!each | 00000890 6c 69 6e 65 20 69 73 20 65 78 65 63 75 74 65 64 |line is executed| 000008a0 2e 20 57 65 27 6c 6c 20 73 65 74 20 61 20 62 72 |. We'll set a br| 000008b0 65 61 6b 70 6f 69 6e 74 20 61 74 20 74 68 65 20 |eakpoint at the | 000008c0 65 6e 64 20 6f 66 20 74 68 65 0d 0a 21 70 72 6f |end of the..!pro| 000008d0 67 72 61 6d 20 73 6f 20 77 65 20 63 61 6e 20 65 |gram so we can e| 000008e0 78 61 6d 69 6e 65 20 74 68 65 73 65 20 63 6f 75 |xamine these cou| 000008f0 6e 74 73 2e 0d 0a 21 0d 0a 50 52 4f 46 49 4c 45 |nts...!..PROFILE| 00000900 0d 0a 47 20 32 36 31 0d 0a 21 0d 0a 21 4e 6f 77 |..G 261..!..!Now| 00000910 20 69 66 20 77 65 20 75 73 65 20 74 68 65 20 6c | if we use the l| 00000920 69 73 74 20 63 6f 6d 6d 61 6e 64 2c 20 74 68 65 |ist command, the| 00000930 20 65 78 65 63 75 74 69 6f 6e 20 63 6f 75 6e 74 | execution count| 00000940 73 20 61 72 65 20 64 69 73 70 6c 61 79 65 64 0d |s are displayed.| 00000950 0a 21 62 65 73 69 64 65 20 65 61 63 68 20 6c 69 |.!beside each li| 00000960 6e 65 2e 0d 0a 21 0d 0a 4c 49 53 54 20 32 35 30 |ne...!..LIST 250| 00000970 2e 2e 32 36 31 0d 0a 21 0d 0a 21 4e 6f 74 65 20 |..261..!..!Note | 00000980 77 65 20 6f 6e 6c 79 20 73 74 61 72 74 65 64 20 |we only started | 00000990 63 6f 75 6e 74 69 6e 67 20 77 68 65 6e 20 77 65 |counting when we| 000009a0 20 73 65 6c 65 63 74 65 64 20 74 68 65 20 50 20 | selected the P | 000009b0 6f 70 74 69 6f 6e 2e 0d 0a 21 54 68 61 74 20 6d |option...!That m| 000009c0 6f 72 65 20 6f 72 20 6c 65 73 73 20 77 72 61 70 |ore or less wrap| 000009d0 73 20 75 70 20 74 68 65 20 64 65 6d 6f 2e 20 54 |s up the demo. T| 000009e0 77 6f 20 6f 74 68 65 72 20 76 65 72 79 20 75 73 |wo other very us| 000009f0 65 66 75 6c 20 63 6f 6d 6d 61 6e 64 73 0d 0a 21 |eful commands..!| 00000a00 72 65 6d 61 69 6e 20 74 6f 20 62 65 20 64 65 73 |remain to be des| 00000a10 63 72 69 62 65 64 20 28 70 6c 75 73 20 61 20 66 |cribed (plus a f| 00000a20 65 77 20 6d 6f 72 65 20 65 73 6f 74 65 72 69 63 |ew more esoteric| 00000a30 20 6f 6e 65 73 29 2e 0d 0a 21 0d 0a 21 46 69 72 | ones)...!..!Fir| 00000a40 73 74 6c 79 2c 20 74 68 65 20 68 65 6c 70 20 63 |stly, the help c| 00000a50 6f 6d 6d 61 6e 64 20 2d 20 79 6f 75 20 63 61 6e |ommand - you can| 00000a60 20 67 65 74 20 67 65 6e 65 72 61 6c 20 68 65 6c | get general hel| 00000a70 70 20 2e 2e 2e 0d 0a 21 0d 0a 48 45 4c 50 0d 0a |p .....!..HELP..| 00000a80 21 0d 0a 21 2e 2e 2e 20 6f 72 20 6d 6f 72 65 20 |!..!... or more | 00000a90 73 70 65 63 69 66 69 63 20 68 65 6c 70 2e 0d 0a |specific help...| 00000aa0 21 0d 0a 48 45 4c 50 20 54 52 41 43 45 0d 0a 21 |!..HELP TRACE..!| 00000ab0 0d 0a 21 41 6e 64 20 6c 61 73 74 6c 79 2c 20 74 |..!And lastly, t| 00000ac0 68 65 20 51 55 49 54 20 63 6f 6d 6d 61 6e 64 2e |he QUIT command.| 00000ad0 20 54 68 69 73 20 69 73 20 74 68 65 20 6f 6e 65 | This is the one| 00000ae0 20 50 72 6f 62 65 20 63 6f 6d 6d 61 6e 64 20 77 | Probe command w| 00000af0 68 69 63 68 0d 0a 21 63 61 6e 6e 6f 74 20 62 65 |hich..!cannot be| 00000b00 20 61 62 62 72 65 76 69 61 74 65 64 2e 0d 0a 21 | abbreviated...!| 00000b10 0d 0a 51 55 49 54 0d 0a 0d 0a |..QUIT....| 00000b1a