home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 545a.lha / PowerVisor_v1.0 / docs.LZH / docs / Debug < prev    next >
Encoding:
Text File  |  1991-08-22  |  44.8 KB  |  1,023 lines

  1. *-----------------*
  2. * Tutorial: Debug * Wed Aug 21 20:57:43 1991
  3. *-----------------*
  4.  
  5. ===================== Commands used in this tutorial =========================
  6.  
  7.    break       Control breakpoints
  8.    debug       Control debug tasks
  9.    disp        Display integer
  10.    drefresh    Refresh debug display
  11.    dscroll     Scroll in debug display
  12.    dstart      Set start programcounter in debug display
  13.    duse        Set the default debug task
  14.    dwin        Open/close 'Debug' logical window
  15.    info        Ask information about a structure or node
  16.    list        List structures
  17.    loadfd      Load fd-file
  18.    prefs       Set preferences
  19.    symbol      Control symbols
  20.    trace       Control tracing
  21.    unasm       Disassemble memory
  22.    with        Temporarily set the default debug task
  23.  
  24. ===================== Functions used in this tutorial ========================
  25.  
  26.    botpc       Get the programcounter at the bottom of the display
  27.    toppc       Get the programcounter at the top of the display
  28.  
  29. ============================== Introduction ==================================
  30.  
  31. I don't think that you will be surprised if I tell you that PowerVisor can
  32. even debug programs :-) This file explains how you should do this. It also
  33. explains how you can make life easier with a fully customized
  34. ²fullscreen debugger. PowerVisor is a very powerful debugger. For example,
  35. you can ³debug multiple tasks at the same time.
  36.  
  37. ============================ Loading a program ===============================
  38.  
  39. There are several ways to load a program. The method you chooses depends on
  40. what you really need. The 'debug' command is provided by PowerVisor to
  41. control the ²debug tasks (or debug nodes). All the ²debug nodes can be found
  42. in the ²'dbug' list. With the 'debug' command you can load a program, you can
  43. unload a program and you can do other things as well.
  44.  
  45. =========================== An example session ===============================
  46.  
  47. This section contains a complete example debugging session. Note that we
  48. do not use the ²fullscreen debugger in this example. Use of the fullscreen
  49. debugger is explained later. It is recommended that you type each command
  50. as it appears here. Note that the output given here assumes that you have
  51. all preferences set to default values (use 'mode shex', 'prefs dmode f' and
  52. 'prefs debug 5 1' if you are not sure that the default values are used).
  53.  
  54. -------------------------- Starting the session ------------------------------
  55.  
  56. 'debug n' is the recommended way to load a program. 'debug n' waits for
  57. the next program that is started and interrupts it before the first
  58. instruction is executed. To do this, 'debug n' patches the Dos ¹LoadSeg
  59. function. Example :
  60.  
  61. < debug n <enter>
  62.  
  63. PowerVisor waits for you to start the program you want to debug. You
  64. can start this program from the ¹WorkBench (click on the icon) or you
  65. can start it from the Cli or Shell. I have provided an example program
  66. with a ²resident breakpoint. Resident breakpoints are explained later
  67. in this file. You can find this program in the ²'Examples' subdirectory.
  68.  
  69. CLI< examples/buggyprogram <enter>
  70. or
  71. CLI< run examples/buggyprogram <enter>
  72.  
  73. (Note ! Only use 'run' when 'run' is ¹resident or a built-in shell command,
  74. in other words: don't use 'run' when 'run' itself must be loaded from disk
  75. with 'loadseg'. You probably don't want to debug 'run' :-) 'run' is always
  76. resident in AmigaDOS 2.0)
  77.  
  78. (Note ! When PowerVisor is waiting for a program you must be careful not
  79. to use any other program (that is already running) that might use LoadSeg
  80. for some other purpose. Fonts, for example, are loaded using LoadSeg)
  81.  
  82. (Note ! You can ¹interrupt 'debug n' with ¹<esc>)
  83.  
  84. 'debug n' is the best way to load a debug task because the program runs
  85. in exactly the same environment as the environment you get when you simply
  86. run the program.
  87.  
  88. Allright, we have now loaded the program in memory.
  89.  
  90. < list dbug <enter>
  91. > Debug task          : Node     Task     InitPC   TD ID Mode  SMode TMode
  92. > ---------------------------------------------------------------------------
  93. > Background CLI      : 07EA7A58 07EF8FA8 07EAA7D8 FF FF NONE  WAIT  NORM
  94.  
  95. Most of this information is rather technical and is not very interesting at
  96. this moment. 'InitPC' is interesting though. Let's try :
  97.  
  98. < u 07EAA7D8 <enter>
  99. or
  100. < unasm 07EAA7D8 <enter>
  101.  
  102. > 07EAA7D8: 7200                          MOVEQ.L  #0,D1
  103. > 07EAA7DA: 7064                          MOVEQ.L  #$64,D0
  104. > 07EAA7DC: 5281                          ADDQ.L   #1,D1
  105. > 07EAA7DE: 51C8 FFFC                     DBF      D0,$7EAA7DC
  106. > 07EAA7E2: 6100 0010                     BSR      $7EAA7F4
  107. > 07EAA7E6: 6708                          BEQ      $7EAA7F0
  108. > 07EAA7E8: 6100 0022                     BSR      $7EAA80C
  109. > 07EAA7EC: 6100 0046                     BSR      $7EAA834
  110. > 07EAA7F0: 7000                          MOVEQ.L  #0,D0
  111. > 07EAA7F2: 4E75                          RTS
  112. > 07EAA7F4: 203C 0000 0064                MOVE.L   #$64,D0
  113. > 07EAA7FA: 7200                          MOVEQ.L  #0,D1
  114. > 07EAA7FC: 2C78 0004                     MOVEA.L  (4),A6
  115. > 07EAA800: 4EAE FF3A                     JSR      ($FF3A,A6)
  116. > 07EAA804: 41FA 0042                     LEA      ($7EAA848,PC),A0
  117. > 07EAA808: 2080                          MOVE.L   D0,(A0)
  118. > 07EAA80A: 4E75                          RTS
  119. > 07EAA80C: 7000                          MOVEQ.L  #0,D0
  120. > 07EAA80E: 7201                          MOVEQ.L  #1,D1
  121. > 07EAA810: 7402                          MOVEQ.L  #2,D2
  122.  
  123. Well, this is our program. But there are ²symbol hunks in our program.
  124. 'debug n' does not automatically load them ('debug l' does, but this command
  125. will be explained later). You can ²load symbols with the 'symbol' command :
  126.  
  127. < symbol l examples/buggyprogram <enter>
  128.  
  129. < u 07EAA7D8 <enter>
  130. > StartProgr7200                          MOVEQ.L  #0,D1
  131. > 07EAA7DA: 7064                          MOVEQ.L  #$64,D0
  132. > loop      5281                          ADDQ.L   #1,D1
  133. > 07EAA7DE: 51C8 FFFC                     DBF      D0,loop
  134. > 07EAA7E2: 6100 0010                     BSR      Sub1
  135. > 07EAA7E6: 6708                          BEQ      theend
  136. > 07EAA7E8: 6100 0022                     BSR      Sub2
  137. > 07EAA7EC: 6100 0046                     BSR      Sub3
  138. > theend    7000                          MOVEQ.L  #0,D0
  139. > 07EAA7F2: 4E75                          RTS
  140. > Sub1      203C 0000 0064                MOVE.L   #$64,D0
  141. > 07EAA7FA: 7200                          MOVEQ.L  #0,D1
  142. > 07EAA7FC: 2C78 0004                     MOVEA.L  (4),A6
  143. > 07EAA800: 4EAE FF3A                     JSR      ($FF3A,A6)
  144. > 07EAA804: 41FA 0042                     LEA      (Block,PC),A0
  145. > 07EAA808: 2080                          MOVE.L   D0,(A0)
  146. > 07EAA80A: 4E75                          RTS
  147. > Sub2      7000                          MOVEQ.L  #0,D0
  148. > 07EAA80E: 7201                          MOVEQ.L  #1,D1
  149. > 07EAA810: 7402                          MOVEQ.L  #2,D2
  150.  
  151. You can ³show all symbols with the 'symbol' command :
  152.  
  153. < symbol s <enter>
  154. > StartProgram                             : 07EAA7D8 , 132818904
  155. > loop                                     : 07EAA7DC , 132818908
  156. > theend                                   : 07EAA7F0 , 132818928
  157. > Sub1                                     : 07EAA7F4 , 132818932
  158. > Sub2                                     : 07EAA80C , 132818956
  159. > Sub3                                     : 07EAA834 , 132818996
  160. > Block                                    : 07EAA848 , 132819016
  161.  
  162. The two values on the right of each symbol are the same. The only difference
  163. is that the left one is ¹hexadecimal and the right one is ¹decimal.
  164.  
  165. Because we have loaded the symbols for the current debug task we can use the
  166. symbols in ¹expressions. Here are some examples :
  167.  
  168. Disassemble 5 instructions starting with 'StartProgram' (note that symbols
  169. are case sensitive) :
  170.  
  171. < u StartProgram 5 <enter>
  172. > StartProgr7200                          MOVEQ.L  #0,D1
  173. > 07EAA7DA: 7064                          MOVEQ.L  #$64,D0
  174. > loop      5281                          ADDQ.L   #1,D1
  175. > 07EAA7DE: 51C8 FFFC                     DBF      D0,loop
  176. > 07EAA7E2: 6100 0010                     BSR      Sub1
  177.  
  178. Show the distance between subroutine 2 and subroutine 1 :
  179.  
  180. < d Sub2-Sub1 <enter>
  181. > 00000018,24
  182.  
  183. You can do many other things with the 'symbol' command but 'symbol l' and
  184. 'symbol s' are sufficient at this moment.
  185.  
  186. There is still one thing we should do :
  187.  
  188. < loadfd exec fd:exec_lib.fd <enter>
  189.  
  190. With this command PowerVisor loads all the ³library function definitions in
  191. memory. That way PowerVisor will now how to show a ²library function when
  192. one is encountered while ¹tracing. You do not have to load ¹fd-files, but
  193. it is certainly very easy. I have the four big fd-files ('exec.library',
  194. 'graphics.library', 'intuition.library' and 'dos.library') permanently
  195. loaded in memory (I have put four 'loadfd' commands in the
  196. ¹s:PowerVisor-startup file).
  197.  
  198. ----------------------------------Tracing ------------------------------------
  199.  
  200. Now we can start tracing :
  201.  
  202. < trace i <enter>
  203. or
  204. < tr i <enter>
  205. > ---------------------------------------------------------------------------
  206. > D0: 00000001   D1: 01FAA9F5   D2: 00002EE0   D3: 07ED3A1C
  207. > D4: 00000001   D5: 00000001   D6: 01FAA08F   D7: 07EAA7D4
  208. > A0: 07ED3A1C   A1: 07EF9D28   A2: 07E0CEA4   A3: 07EAA7D4
  209. > A4: 07EFCC00   A5: 00F906DE   A6: 00F906D2
  210. > PC: 07EAA7D8   SP: 07EFCBFC   SR: 0010
  211. > 00000000: 0000 0000                     ORI.B    #0,D0
  212. >
  213. > StartProgr7200                          MOVEQ.L  #0,D1
  214. > 07EAA7DA: 7064                          MOVEQ.L  #$64,D0
  215. > loop      5281                          ADDQ.L   #1,D1
  216. > 07EAA7DE: 51C8 FFFC                     DBF      D0,loop
  217. > 07EAA7E2: 6100 0010                     BSR      Sub1
  218.  
  219. (tr i : give 'I'nformation)
  220. This command shows where we are. No actual tracing is done. The registers
  221. are shown and the five first instructions. The program counter points to the
  222. second instruction in this output. The first instruction is always equal to
  223. the previous executed instruction. Initially it is initialized to address 0.
  224. Note that you can change the format of this output with the 'prefs dmode'
  225. and 'prefs debug' commands (See the 'InstallingPowerVisor' file).
  226.  
  227. Now we are really going to trace one instruction :
  228.  
  229. < tr <enter>
  230. > ---------------------------------------------------------------------------
  231. > D0: 00000001   D1: 00000000   D2: 00002EE0   D3: 07ED3A1C
  232. > D4: 00000001   D5: 00000001   D6: 01FAA08F   D7: 07EAA7D4
  233. > A0: 07ED3A1C   A1: 07EF9D28   A2: 07E0CEA4   A3: 07EAA7D4
  234. > A4: 07EFCC00   A5: 00F906DE   A6: 00F906D2
  235. > PC: 07EAA7DA   SP: 07EFCBFC   SR: 0014
  236. > StartProgr7200                          MOVEQ.L  #0,D1
  237. >
  238. > 07EAA7DA: 7064                          MOVEQ.L  #$64,D0
  239. > loop      5281                          ADDQ.L   #1,D1
  240. > 07EAA7DE: 51C8 FFFC                     DBF      D0,loop
  241. > 07EAA7E2: 6100 0010                     BSR      Sub1
  242. > 07EAA7E6: 6708                          BEQ      theend
  243.  
  244. In the register display you can see that 'd1' now has the value 0.
  245. 'StartProgr' is now the previous instruction. The programcounter now points
  246. to the instruction 'moveq.l #$64,d0'.
  247.  
  248. Trace six instructions at once :
  249.  
  250. < tr n 6 <enter>
  251. > ---------------------------------------------------------------------------
  252. > D0: 00000062   D1: 00000003   D2: 00002EE0   D3: 07ED3A1C
  253. > D4: 00000001   D5: 00000001   D6: 01FAA08F   D7: 07EAA7D4
  254. > A0: 07ED3A1C   A1: 07EF9D28   A2: 07E0CEA4   A3: 07EAA7D4
  255. > A4: 07EFCC00   A5: 00F906DE   A6: 00F906D2
  256. > PC: 07EAA7DE   SP: 07EFCBFC   SR: 0000
  257. > loop      5281                          ADDQ.L   #1,D1
  258. >
  259. > 07EAA7DE: 51C8 FFFC                     DBF      D0,loop
  260. > 07EAA7E2: 6100 0010                     BSR      Sub1
  261. > 07EAA7E6: 6708                          BEQ      theend
  262. > 07EAA7E8: 6100 0022                     BSR      Sub2
  263. > 07EAA7EC: 6100 0046                     BSR      Sub3
  264.  
  265. (tr n : trace 'N'umber instruction)
  266. We are now in the loop.
  267.  
  268. To ²step over the loop we can use the following instruction :
  269.  
  270. < tr o <enter>
  271. > ---------------------------------------------------------------------------
  272. > D0: 0000FFFF   D1: 00000065   D2: 00002EE0   D3: 07ED3A1C
  273. > D4: 00000001   D5: 00000001   D6: 01FAA08F   D7: 07EAA7D4
  274. > A0: 07ED3A1C   A1: 07EF9D28   A2: 07E0CEA4   A3: 07EAA7D4
  275. > A4: 07EFCC00   A5: 00F906DE   A6: 00F906D2
  276. > PC: 07EAA7E2   SP: 07EFCBFC   SR: 0000
  277. > 07EAA7DE: 51C8 FFFC                     DBF      D0,loop
  278. >
  279. > 07EAA7E2: 6100 0010                     BSR      Sub1
  280. > 07EAA7E6: 6708                          BEQ      theend
  281. > 07EAA7E8: 6100 0022                     BSR      Sub2
  282. > 07EAA7EC: 6100 0046                     BSR      Sub3
  283. > theend    7000                          MOVEQ.L  #0,D0
  284. > Breakpoint...
  285.  
  286. (tr o : trace 'O'ver)
  287. 'tr o' places a ¹breakpoint after the current instruction and then executes
  288. until the breakpoint is encountered. You can trace over every instruction
  289. with this command, but you can't use it in ¹ROM-code since PowerVisor can't
  290. put a ³breakpoint in ROM (don't worry ! there are solutions to this problem,
  291. we will see them later on).
  292.  
  293. We step into the subroutine 'Sub1' with :
  294.  
  295. < tr <enter>
  296. > ---------------------------------------------------------------------------
  297. > D0: 0000FFFF   D1: 00000065   D2: 00002EE0   D3: 07ED3A1C
  298. > D4: 00000001   D5: 00000001   D6: 01FAA08F   D7: 07EAA7D4
  299. > A0: 07ED3A1C   A1: 07EF9D28   A2: 07E0CEA4   A3: 07EAA7D4
  300. > A4: 07EFCC00   A5: 00F906DE   A6: 00F906D2
  301. > PC: 07EAA7F4   SP: 07EFCBF8   SR: 0000
  302. > 07EAA7E2: 6100 0010                     BSR      Sub1
  303. >
  304. > Sub1      203C 0000 0064                MOVE.L   #$64,D0
  305. > 07EAA7FA: 7200                          MOVEQ.L  #0,D1
  306. > 07EAA7FC: 2C78 0004                     MOVEA.L  (4),A6
  307. > 07EAA800: 4EAE FF3A                     JSR      ($FF3A,A6)
  308. > 07EAA804: 41FA 0042                     LEA      (Block,PC),A0
  309.  
  310. Trace another three instructions :
  311.  
  312. < tr n 3 <enter>
  313. > ---------------------------------------------------------------------------
  314. > D0: 00000064   D1: 00000000   D2: 00002EE0   D3: 07ED3A1C
  315. > D4: 00000001   D5: 00000001   D6: 01FAA08F   D7: 07EAA7D4
  316. > A0: 07ED3A1C   A1: 07EF9D28   A2: 07E0CEA4   A3: 07EAA7D4
  317. > A4: 07EFCC00   A5: 00F906DE   A6: 07E007D8
  318. > PC: 07EAA800   SP: 07EFCBF8   SR: 0004
  319. > 07EAA7FC: 2C78 0004                     MOVEA.L  (4),A6
  320. >
  321. > 07EAA800: 4EAE FF3A                     JSR      (AllocMem,A6)
  322. > 07EAA804: 41FA 0042                     LEA      (Block,PC),A0
  323. > 07EAA808: 2080                          MOVE.L   D0,(A0)
  324. > 07EAA80A: 4E75                          RTS
  325. > Sub2      7000                          MOVEQ.L  #0,D0
  326.  
  327. Thanks to the loaded fd-file you can now see that this function is actually
  328. the Exec AllocMem. We do not want to run through the complete rom function
  329. so we ²trace over the call with :
  330.  
  331. < tr t <enter>
  332. > ---------------------------------------------------------------------------
  333. > D0: 07EFCE90   D1: 00002F48   D2: 00002EE0   D3: 07ED3A1C
  334. > D4: 00000001   D5: 00000001   D6: 01FAA08F   D7: 07EAA7D4
  335. > A0: 07E00000   A1: 07EFCE90   A2: 07E0CEA4   A3: 07EAA7D4
  336. > A4: 07EFCC00   A5: 00F906DE   A6: 07E007D8
  337. > PC: 07EAA804   SP: 07EFCBF8   SR: 0010
  338. > 07EAA800: 4EAE FF3A                     JSR      ($FF3A,A6)
  339. >
  340. > 07EAA804: 41FA 0042                     LEA      (Block,PC),A0
  341. > 07EAA808: 2080                          MOVE.L   D0,(A0)
  342. > 07EAA80A: 4E75                          RTS
  343. > Sub2      7000                          MOVEQ.L  #0,D0
  344. > 07EAA80E: 7201                          MOVEQ.L  #1,D1
  345. > Breakpoint...
  346.  
  347. (tr t : 'T'race over BSR or JSR      sorry, couldn't find a better character)
  348. 'tr t' looks similar to 'tr o'. The big difference is that 'tr t' works only
  349. for 'BSR' and 'JSR' instructions. And what is more important : 'tr t' works
  350. in ¹ROM-code. If 'tr t' is used for an instruction other than 'BSR' or 'JSR'
  351. it is analogous to 'tr' (simple singlestep).
  352.  
  353. We can see that the AllocMem function had success (I hope this is really the
  354. case) because 'd0' contains the address of the newly allocated memory.
  355.  
  356. We continue tracing until the next ³change of program flow happens :
  357.  
  358. < tr b <enter>
  359. > ---------------------------------------------------------------------------
  360. > D0: 07EFCE90   D1: 00002F48   D2: 00002EE0   D3: 07ED3A1C
  361. > D4: 00000001   D5: 00000001   D6: 01FAA08F   D7: 07EAA7D4
  362. > A0: 07EAA848   A1: 07EFCE90   A2: 07E0CEA4   A3: 07EAA7D4
  363. > A4: 07EFCC00   A5: 00F906DE   A6: 07E007D8
  364. > PC: 07EAA80A   SP: 07EFCBF8   SR: 0010
  365. > 07EAA808: 2080                          MOVE.L   D0,(A0)
  366. >
  367. > 07EAA80A: 4E75                          RTS
  368. > Sub2      7000                          MOVEQ.L  #0,D0
  369. > 07EAA80E: 7201                          MOVEQ.L  #1,D1
  370. > 07EAA810: 7402                          MOVEQ.L  #2,D2
  371. > 07EAA812: 7603                          MOVEQ.L  #3,D3
  372.  
  373. (tr b : trace until 'B'ranch)
  374. 'tr b' traces until a change of program control happens. This means that
  375. tracing will stop always at the following instructions :
  376.    JMP
  377.    JSR
  378.    BRA
  379.    BSR
  380.    RTE
  381.    RTD
  382.    RTR
  383.    RTS
  384.    TRAP
  385. and tracing will stop at the following instructions if the brach would
  386. succeed :
  387.    Bcc
  388.    DBcc
  389.  
  390. Go out this subroutine :
  391.  
  392. < tr <enter>
  393. > ---------------------------------------------------------------------------
  394. > D0: 07EFCE90   D1: 00002F48   D2: 00002EE0   D3: 07ED3A1C
  395. > D4: 00000001   D5: 00000001   D6: 01FAA08F   D7: 07EAA7D4
  396. > A0: 07EAA848   A1: 07EFCE90   A2: 07E0CEA4   A3: 07EAA7D4
  397. > A4: 07EFCC00   A5: 00F906DE   A6: 07E007D8
  398. > PC: 07EAA7E6   SP: 07EFCBFC   SR: 0010
  399. > 07EAA80A: 4E75                          RTS
  400. >
  401. > 07EAA7E6: 6708                          BEQ      theend
  402. > 07EAA7E8: 6100 0022                     BSR      Sub2
  403. > 07EAA7EC: 6100 0046                     BSR      Sub3
  404. > theend    7000                          MOVEQ.L  #0,D0
  405. > 07EAA7F2: 4E75                          RTS
  406.  
  407. < tr <enter>
  408. > ---------------------------------------------------------------------------
  409. > D0: 07EFCE90   D1: 00002F48   D2: 00002EE0   D3: 07ED3A1C
  410. > D4: 00000001   D5: 00000001   D6: 01FAA08F   D7: 07EAA7D4
  411. > A0: 07EAA848   A1: 07EFCE90   A2: 07E0CEA4   A3: 07EAA7D4
  412. > A4: 07EFCC00   A5: 00F906DE   A6: 07E007D8
  413. > PC: 07EAA7E8   SP: 07EFCBFC   SR: 0010
  414. > 07EAA7E6: 6708                          BEQ      theend
  415. >
  416. > 07EAA7E8: 6100 0022                     BSR      Sub2
  417. > 07EAA7EC: 6100 0046                     BSR      Sub3
  418. > theend    7000                          MOVEQ.L  #0,D0
  419. > 07EAA7F2: 4E75                          RTS
  420. > Sub1      203C 0000 0064                MOVE.L   #$64,D0
  421.  
  422. We suspect nothing bad in 'Sub2' so we simply trace over it :
  423.  
  424. < tr t <enter>
  425. > ---------------------------------------------------------------------------
  426. > D0: 00000000   D1: 00000001   D2: 00000002   D3: 00000003
  427. > D4: 00000004   D5: 00000005   D6: 00000006   D7: 00000007
  428. > A0: 07EFCE90   A1: 07EFCE90   A2: 07E0CEA4   A3: 07EAA7D4
  429. > A4: 07EFCC00   A5: 00F906DE   A6: 07E007D8
  430. > PC: 07EAA820   SP: 07EFCBF8   SR: 0010
  431. > 07EAA7E8: 6100 0022                     BSR      Sub2
  432. >
  433. > 07EAA820: 4AFC                          ILLEGAL
  434. > 07EAA822: 20C0                          MOVE.L   D0,(A0)+
  435. > 07EAA824: 20C1                          MOVE.L   D1,(A0)+
  436. > 07EAA826: 20C2                          MOVE.L   D2,(A0)+
  437. > 07EAA828: 20C3                          MOVE.L   D3,(A0)+
  438. > Illegal instruction !
  439.  
  440. There is something wrong ! This is called a ²²resident breakpoint. You can
  441. put resident breakpoints in a program using the ²'ILLEGAL' instruction.
  442. PowerVisor will automatically stop at such places.
  443.  
  444. ²Skip over the instruction with :
  445.  
  446. < tr s <enter>
  447. > ---------------------------------------------------------------------------
  448. > D0: 00000000   D1: 00000001   D2: 00000002   D3: 00000003
  449. > D4: 00000004   D5: 00000005   D6: 00000006   D7: 00000007
  450. > A0: 07EFCE90   A1: 07EFCE90   A2: 07E0CEA4   A3: 07EAA7D4
  451. > A4: 07EFCC00   A5: 00F906DE   A6: 07E007D8
  452. > PC: 07EAA820   SP: 07EFCBF8   SR: 0010
  453. > 07EAA820: 4AFC                          ILLEGAL
  454. >
  455. > 07EAA822: 20C0                          MOVE.L   D0,(A0)+
  456. > 07EAA824: 20C1                          MOVE.L   D1,(A0)+
  457. > 07EAA826: 20C2                          MOVE.L   D2,(A0)+
  458. > 07EAA828: 20C3                          MOVE.L   D3,(A0)+
  459. > 07EAA82A: 20C4                          MOVE.L   D4,(A0)+
  460.  
  461. ('tr s' : 'S'kip instruction)
  462. Now we have something special. Since we used the 'tr t' command to trace
  463. over the subroutine 'Sub2' we have created a breakpoint after the 'BSR Sub2'
  464. instruction. But if we would look after the 'BSR Sub2' instruction we
  465. would find no breakpoint (we will see later how PowerVisor shows breakpoints
  466. in the disassembly display). This is because the 'tr t' command works in
  467. a special way to make sure that you can use it in ROM-code too. Here follows
  468. an explanation of what has happened :
  469.  
  470.       You typed 'tr t' when to skip 'BSR Sub2' a time ago.
  471.       PowerVisor performs a 'tr' to trace the 'BSR' instruction.
  472.       Now the top of the stack contains the returnaddress for the 'BSR'
  473.       instruction, this is the address of the instruction after 'BSR Sub2'.
  474.       PowerVisor replaces the address on the stack with another address.
  475.       This address points to a ²private breakpoint. Since this private
  476.       breakpoint is always in RAM, there is no problem setting this
  477.       breakpoint. When the subroutine returns (with 'RTS') later on (this
  478.       has not happened at this moment), it will not return to the instruction
  479.       after the 'BSR' but to the breakpoint in RAM. PowerVisor will trap this
  480.       and set the programcounter of the task to the right address: this is
  481.       the instruction after the 'BSR Sub2'.
  482.  
  483.       It would be different if you hade used 'tr o' instead of 'tr t'. 'tr o'
  484.       would put a breakpoint directly after the 'BSR Sub2'. This will
  485.       ofcourse not work if the 'BSR' is in ROM since a breakpoint is in fact
  486.       an ILLEGAL instruction.
  487.  
  488. But since the routine 'Sub2' was interrupted (the 'ILLEGAL' instruction
  489. caused this). The private breakpoint has not been encountered yet and
  490. the value on the stack is still the wrong value. We can make use of this
  491. feature and simply continue the 'tr t' where it left of with :
  492.  
  493. < tr g <enter>
  494. > ---------------------------------------------------------------------------
  495. > D0: 00000000   D1: 00000001   D2: 00000002   D3: 00000003
  496. > D4: 00000004   D5: 00000005   D6: 00000006   D7: 00000007
  497. > A0: 07EFCEB0   A1: 07EFCE90   A2: 07E0CEA4   A3: 07EAA7D4
  498. > A4: 07EFCC00   A5: 00F906DE   A6: 07E007D8
  499. > PC: 07EAA7EC   SP: 07EFCBFC   SR: 0010
  500. > 07EAA822: 20C0                          MOVE.L   D0,(A0)+
  501. >
  502. > 07EAA7EC: 6100 0046                     BSR      Sub3
  503. > theend    7000                          MOVEQ.L  #0,D0
  504. > 07EAA7F2: 4E75                          RTS
  505. > Sub1      203C 0000 0064                MOVE.L   #$64,D0
  506. > 07EAA7FA: 7200                          MOVEQ.L  #0,D1
  507. > Breakpoint...
  508.  
  509. ('tr g' : trace 'G'o)
  510. The 'tr g' command simply executes the program until a breakpoint is
  511. encountered.
  512. Note that it would make no difference if you would trace the program step
  513. by step. At one moment you would encounter the ²private breakpoint. Simply
  514. tracing over this breakpoint will return to the correct place in the
  515. program.
  516.  
  517. We step into 'Sub3' :
  518.  
  519. < tr <enter>
  520. > ---------------------------------------------------------------------------
  521. > D0: 00000000   D1: 00000001   D2: 00000002   D3: 00000003
  522. > D4: 00000004   D5: 00000005   D6: 00000006   D7: 00000007
  523. > A0: 07EFCEB0   A1: 07EFCE90   A2: 07E0CEA4   A3: 07EAA7D4
  524. > A4: 07EFCC00   A5: 00F906DE   A6: 07E007D8
  525. > PC: 07EAA834   SP: 07EFCBF8   SR: 0010
  526. > 07EAA7EC: 6100 0046                     BSR      Sub3
  527. >
  528. > Sub3      203C 0000 0040                MOVE.L   #$40,D0
  529. > 07EAA83A: 227A 000C                     MOVEA.L  (Block,PC),A1
  530. > 07EAA83E: 2C78 0004                     MOVEA.L  (4),A6
  531. > 07EAA842: 4EAE FF2E                     JSR      ($FF2E,A6)
  532. > 07EAA846: 4E75                          RTS
  533.  
  534. < tr <enter>
  535. > ---------------------------------------------------------------------------
  536. > D0: 00000040   D1: 00000001   D2: 00000002   D3: 00000003
  537. > D4: 00000004   D5: 00000005   D6: 00000006   D7: 00000007
  538. > A0: 07EFCEB0   A1: 07EFCE90   A2: 07E0CEA4   A3: 07EAA7D4
  539. > A4: 07EFCC00   A5: 00F906DE   A6: 07E007D8
  540. > PC: 07EAA83A   SP: 07EFCBF8   SR: 0010
  541. > Sub3      203C 0000 0040                MOVE.L   #$40,D0
  542. >
  543. > 07EAA83A: 227A 000C                     MOVEA.L  (Block,PC),A1
  544. > 07EAA83E: 2C78 0004                     MOVEA.L  (4),A6
  545. > 07EAA842: 4EAE FF2E                     JSR      ($FF2E,A6)
  546. > 07EAA846: 4E75                          RTS
  547. > Block     07EF CE90                     BSET     D3,($CE90,A7)
  548.  
  549. We see that something is wrong. We have allocated 100 bytes of memory
  550. ($64) but we are only going to free 64 bytes ($40). This is clearly
  551. a bug and should be fixed. But to prevent memoryloss we are going to
  552. continue anyway. We simply change the 'd0' ¹register :
  553.  
  554. < d @d0 <enter>
  555. > 00000040,64
  556.  
  557. < @d0=100 <enter>
  558.  
  559. You see how we can look at registers and change their values.
  560.  
  561. We are not interested in the rest of the program. We simply let it go :
  562.  
  563. < tr g <enter>
  564. > Program quits !
  565.  
  566. The program has stopped.
  567.  
  568. Some important 'trace' commands have been explained. There are a lot more.
  569. Some of the other 'trace' commands will be used in the following example.
  570. You have to refer to the online help or to the 'CommandReference' file for
  571. the other features.
  572.  
  573. ============================ Example session 2 ===============================
  574.  
  575. I have prepared another program so you can see the power of PowerVisor.
  576. With this example we are going to make you used to breakpoints and some
  577. other advanced features of the 'trace' command. We are also going to use
  578. the ²²fullscreen debugger (Note that I will explain later how you can
  579. customize this fullscreen debugger to your wishes and how you can use
  580. the 'db' script to do this for you).
  581.  
  582. -------------------------- Starting the session ------------------------------
  583.  
  584. We are now going to load the program using 'debug l'. Normally this is
  585. not the recommended way since this instruction does not perfectly emulate
  586. a ¹Cli or ¹WorkBench (this could change in future). But this does not matter
  587. for our little program.
  588.  
  589. < debug l examples/buggyprogram2 <enter>
  590.  
  591. The symbols are automatically loaded by 'debug l' :
  592.  
  593. < symbol s <enter>
  594. > StartProgram                             : 07EADCC0 , 132832448
  595. > Long                                     : 07EADCCE , 132832462
  596. > recur                                    : 07EADCE0 , 132832480
  597. > theend                                   : 07EADCEC , 132832492
  598.  
  599. Open the fullscreen debugger display :
  600.  
  601. < dwin <enter>
  602. < prefs dmode n <enter>
  603.  
  604. The 'prefs dmode' command is used to disable the output on the 'Main'
  605. logical window you normally get after each trace. All the output goes
  606. automatically to the 'Debug' logical window if it is open (but if you
  607. set 'prefs dmode f' as it is default you will get output in the 'Debug'
  608. logical window AND on the 'Main' logical window. This is probably not
  609. as intended).
  610.  
  611. Drag the ²horizontal bar between the ³'Main' logical window and the
  612. ³'Debug' logical window until all the five instructions of the disassembly
  613. are visible.
  614.  
  615. The following ¹keys can be used :
  616.       <ctrl>+<NumPad Up>      to decrease the top visible instruction address
  617.                               with 2
  618.       <ctrl>+<NumPad Down>    to increase this address with 2
  619.       <ctrl>+<NumPad PgUp>    to decrease this address with 20
  620.       <ctrl>+<NumPad PgDn>    to increase this address with 20
  621.       <ctrl>+<NumPad 5>       to set this address equal to the programcounter
  622. Using this keys you can ¹scroll through your code (try it).
  623.  
  624. Press :
  625.  
  626. < <ctrl>+<NumPad 5>
  627.  
  628. To go back to the programcounter.
  629. (Note that you can also use the 'dscroll' and 'dstart' commands to scroll
  630. through your program, see the 'CommandReference' file)
  631.  
  632. The fullscreen debugger display looks almost the same as the output from
  633. the 'trace' command in the earlier section. The differences are :
  634.  
  635.    - There is an indicator of what the task is doing.
  636.          NONE     the task is waiting for PowerVisor instructions
  637.          TRACE    the task is tracing
  638.          EXEC     the task is executing
  639.    - The top instruction (except for the previous instruction indicator)
  640.      is not always equal to the instruction at the ¹programcounter. The
  641.      programcounter is indicated by ²the vertical bar '|' in front of the
  642.      instruction.
  643.    - The ²previous instruction is only updated when the programcounter makes
  644.      a jump out of the current displayed instructions.
  645.  
  646. ------------------------------- Breakpoints ----------------------------------
  647.  
  648. First a simple ¹¹breakpoint :
  649.  
  650. Lets put a breakpoint in the 'Long' subroutine.
  651.  
  652. < u Long <enter>
  653. > Long      7000                          MOVEQ.L  #0,D0
  654. > 07EADCD0: 7201                          MOVEQ.L  #1,D1
  655. > 07EADCD2: 7402                          MOVEQ.L  #2,D2
  656. > 07EADCD4: 7603                          MOVEQ.L  #3,D3
  657. > 07EADCD6: 7804                          MOVEQ.L  #4,D4
  658. > 07EADCD8: 7A05                          MOVEQ.L  #5,D5
  659. > 07EADCDA: 7C06                          MOVEQ.L  #6,D6
  660. > 07EADCDC: 7E07                          MOVEQ.L  #7,D7
  661. > 07EADCDE: 4E75                          RTS
  662. > recur     5280                          ADDQ.L   #1,D0
  663. > 07EADCE2: 0C80 0000 00C8                CMPI.L   #$C8,D0
  664. > 07EADCE8: 6E02                          BGT      theend
  665. > 07EADCEA: 61F4                          BSR      recur
  666. > theend    4E75                          RTS
  667. > 07EADCEE: 0000 07EA                     ORI.B    #$EA,D0
  668. > 07EADCF2: DD08                          ADDX.B   -(A0),-(A6)
  669. > 07EADCF4: 0000 0000                     ORI.B    #0,D0
  670. > 07EADCF8: 07E2                          BSET     D3,-(A2)
  671. > 07EADCFA: 68A0                          BVC      $7EADC9C
  672. > 07EADCFC: 0002 004C                     ORI.B    #$4C,D2
  673.  
  674. < break n 07EADCD2 <enter>
  675. or
  676. < b n 07EADCD2 <enter>
  677.  
  678. > 00000001,1
  679.  
  680. ('b n' : 'N'ormal breakpoint)
  681. The output from this command is the breakpoint number. PowerVisor can have
  682. as many breakpoints as memory permits. Breakpoints are always refered to
  683. with their number.
  684.  
  685. With the 'info' command you can now ask more information about the
  686. breakpoints :
  687.  
  688. < l dbug <enter>
  689. > Debug task          : Node     Task     InitPC   TD ID Mode  SMode TMode
  690. > ---------------------------------------------------------------------------
  691. > examples/buggyprogra: 07EADB90 07ED5840 07EADCC0 FF FF NONE  WAIT  NORM
  692.  
  693. < info dbug:'examples/buggyprogram2' dbug <enter>
  694. or
  695. < i db:examp db <enter>
  696.  
  697. > Debug task          : Node     Task     InitPC   TD ID Mode  SMode TMode
  698. > ---------------------------------------------------------------------------
  699. > examples/buggyprogra: 07EADB90 07ED5840 07EADCC0 FF FF NONE  WAIT  NORM
  700. >
  701. > Node     Number Where    UsageCnt Type Condition
  702. > ---------------------------------------------------------------------------
  703. > 07EBA168     1  07EADCD2        0   N
  704.  
  705. We can see that there is one breakpoint defined with number 1 and position
  706. 07EA77DA. It has not been used yet and it is a normal (N) breakpoint.
  707. ('Condition' is explained later).
  708.  
  709. Lets have a look at the disassembly :
  710.  
  711. < u Long <enter>
  712. > Long      7000                          MOVEQ.L  #0,D0
  713. > 07EADCD0: 7201                          MOVEQ.L  #1,D1
  714. > 07EADCD2: 4AFC                          MOVEQ.L  #2,D2  >1
  715. > 07EADCD4: 7603                          MOVEQ.L  #3,D3
  716. > 07EADCD6: 7804                          MOVEQ.L  #4,D4
  717. > 07EADCD8: 7A05                          MOVEQ.L  #5,D5
  718. > 07EADCDA: 7C06                          MOVEQ.L  #6,D6
  719. > 07EADCDC: 7E07                          MOVEQ.L  #7,D7
  720. > 07EADCDE: 4E75                          RTS
  721. > recur     5280                          ADDQ.L   #1,D0
  722. > 07EADCE2: 0C80 0000 00C8                CMPI.L   #$C8,D0
  723. > 07EADCE8: 6E02                          BGT      theend
  724. > 07EADCEA: 61F4                          BSR      recur
  725. > theend    4E75                          RTS
  726. > 07EADCEE: 0000 07EA                     ORI.B    #$EA,D0
  727. > 07EADCF2: DD08                          ADDX.B   -(A0),-(A6)
  728. > 07EADCF4: 0000 0000                     ORI.B    #0,D0
  729. > 07EADCF8: 07E2                          BSET     D3,-(A2)
  730. > 07EADCFA: 68A0                          BVC      $7EADC9C
  731. > 07EADCFC: 0002 004C                     ORI.B    #$4C,D2
  732.  
  733. The breakpoint is the instruction with the '>1' appended.
  734.  
  735. Now we start the program and see where it ends :
  736.  
  737. < tr g <enter>
  738. > Breakpoint...
  739.  
  740. (Notice that we no longer get the complete output on 'Main'. All output
  741. is in the 'Debug' logical window)
  742.  
  743. The breakpoint has been encountered. Since it is a normal breakpoint it
  744. is not removed.
  745.  
  746. < i db:examp db <enter>
  747. > Debug task          : Node     Task     InitPC   TD ID Mode  SMode TMode
  748. > ---------------------------------------------------------------------------
  749. > examples/buggyprogra: 07EADB90 07ED5840 07EADCC0 FF FF NONE  WAIT  NORM
  750. >
  751. > Node     Number Where    UsageCnt Type Condition
  752. > ---------------------------------------------------------------------------
  753. > 07EBA168     1  07EADCD2        1   N
  754.  
  755. Now we see that the ²usage counter has incremented.
  756.  
  757. We make two new breakpoints :
  758.  
  759. < b t 07EADCDA <enter>
  760.  
  761. < b c recur @d0==100 <enter>
  762.  
  763. < i db:exam db <enter>
  764. > Debug task          : Node     Task     InitPC   TD ID Mode  SMode TMode
  765. > ---------------------------------------------------------------------------
  766. > examples/buggyprogra: 07EADB90 07ED5840 07EADCC0 FF FF NONE  WAIT  STEP
  767. >
  768. > Node     Number Where    UsageCnt Type Condition
  769. > ---------------------------------------------------------------------------
  770. > 07EBA288     3  07EADCE0        0   C  @d0==100
  771. > 07EB5B60     2  07EADCDA        0   T
  772. > 07EBA168     1  07EADCD2        1   N
  773.  
  774. ('b t' : 'T'emporary breakpoint)
  775. ('b c' : 'C'onditional breakpoint)
  776. 'b t' makes a ²temporary breakpoint. This is a breakpoint that only breaks
  777. once. 'b c' makes a conditional breakpoint. ²Conditional breakpoints are
  778. very powerful as you will see in the following demonstration.
  779.  
  780. < tr g <enter>
  781. > Breakpoint...
  782.  
  783. The breakpoint breaks and is immediatelly removed.
  784.  
  785. < tr g <enter>
  786. > Breakpoint...
  787.  
  788. The conditional breakpoint breaks because 'd0' is equal to 100. A conditional
  789. breakpoint is a very powerful way to control your program. The breakpoint
  790. conditional can be as complex as you wish (with the exception that you can't
  791. use the ²group operator) and you can refer to all ¹registers like @sp, @d0 to
  792. @d7 and @a0 to @a6.
  793.  
  794. We ³remove the breakpoint with :
  795.  
  796. < b r 3 <enter>
  797.  
  798. ('b r' : 'R'emove breakpoint)
  799.  
  800. Now we are going to put a breakpoint just after the 'BSR' instruction :
  801.  
  802. < u StartProgram <enter>
  803. > StartProgr6100 000C                     BSR      Long
  804. > 07EADCC4: 7000                          MOVEQ.L  #0,D0
  805. > 07EADCC6: 6100 0018                     BSR      recur
  806. > 07EADCCA: 7000                          MOVEQ.L  #0,D0
  807. > 07EADCCC: 4E75                          RTS
  808. > Long      7000                          MOVEQ.L  #0,D0
  809. > 07EADCD0: 7201                          MOVEQ.L  #1,D1
  810. > 07EADCD2: 4AFC                          MOVEQ.L  #2,D2  >1
  811. > 07EADCD4: 7603                          MOVEQ.L  #3,D3
  812. > 07EADCD6: 7804                          MOVEQ.L  #4,D4
  813. > 07EADCD8: 7A05                          MOVEQ.L  #5,D5
  814. > 07EADCDA: 7C06                          MOVEQ.L  #6,D6
  815. > 07EADCDC: 7E07                          MOVEQ.L  #7,D7
  816. > 07EADCDE: 4E75                          RTS
  817. > recur     5280                          ADDQ.L   #1,D0
  818. > 07EADCE2: 0C80 0000 00C8                CMPI.L   #$C8,D0
  819. > 07EADCE8: 6E02                          BGT      theend
  820. > 07EADCEA: 61F4                          BSR      recur
  821. > theend    4E75                          RTS
  822. > 07EADCEE: 0000 07EA                     ORI.B    #$EA,D0
  823.  
  824. We see that there is still another breakpoint present in the 'Long'
  825. subroutine. Remove it with :
  826.  
  827. < b r 1 <enter>
  828.  
  829. We make the new breakpoint :
  830.  
  831. < b n 07EADCCA <enter>
  832. > 00000001,1
  833.  
  834. Now we execute until we reach that breakpoint :
  835.  
  836. < tr g <enter>
  837. > Breakpoint...
  838.  
  839. And we start all over again by setting the programcounter back to the
  840. start of the program :
  841.  
  842. < @pc=StartProgram <enter>
  843.  
  844. Now we are ready to demonstrate yet another powerful feature which looks a
  845. bit like conditional breakpoints : ²conditional tracing.
  846.  
  847. < tr c @d0==100 <enter>
  848.  
  849. ('tr c' : 'C'onditional tracing)
  850. 'tr c' singlesteps the program until the condition is true. The difference
  851. with the conditional breakpoint is that the breakpoint only checks the
  852. condition when the breakpoint is passed. With conditional tracing the
  853. condition is checked after each instruction. Conditional tracing is ofcourse
  854. much slower.
  855.  
  856. Remove the debug task from memory with :
  857.  
  858. < debug r <enter>
  859.  
  860. This command removes all breakpoints and lets the program continue. Note that
  861. you should not use 'debug r' when the program will go berserk after
  862. continuation. Use 'debug f' instead. This command ³freezes the task.
  863.  
  864. Close the debug logical window with :
  865.  
  866. < dwin <enter>
  867.  
  868. =============================== Some theory ==================================
  869.  
  870. When you issue a trace command to PowerVisor, the 'trace' command will return
  871. immediatelly. This means that when the trace could take a long time, you will
  872. still be able to use PowerVisor for other commands. For example, when you are
  873. tracing conditionally, PowerVisor will do absolutely nothing. The debug task
  874. does everything until the condition becomes true. The debug task will then
  875. send a signal to PowerVisor and PowerVisor will update the debug display.
  876.  
  877. The conditional trace command is one of the trace commands that uses
  878. ²singlestep mode for tracing. This is slow but sometimes the only way to
  879. trace something. The 'go' trace command ('tr g') in another trace command.
  880. This trace command uses ²execute mode for tracing. The task runs at full
  881. speed until a breakpoint is encountered. It is possible that you want
  882. singlestep mode for the 'tr g' command too. For example, you could use this
  883. to see how a program runs. Since the program runs a bit slower you will be
  884. able to see much better what happens at each step. To use singlestep mode
  885. with the 'tr g' command you must use 'tr gt' ('t' for trace). Most tracing
  886. commands have these two versions.
  887.  
  888. Note that you can ³interrupt the tracing if you like with 'tr h' or
  889. 'tr f'.
  890.  
  891. Some commands (like 'tr u' and 'tr o' (explained later)) make a temporary
  892. breakpoint. A ²temporary breakpoint is a breakpoint with number 0. This
  893. breakpoint is automatically cleared when another breakpoint with number 0
  894. is about to be created.
  895.  
  896. ========================== Resident breakpoints ==============================
  897.  
  898. You can set ²²resident breakpoints in your programs by including an 'ILLEGAL'
  899. instruction at the right place. When you want to use them you must make sure
  900. that PowerVisor is started and that you use 'mode patch'. Otherwise the
  901. results will not be very satisfactory. After that you simply start your
  902. program (from the 'Shell' or 'Workbench') (Note ! Don't use 'debug n'
  903. in PowerVisor). When the program collides with the resident breakpoint,
  904. PowerVisor will ³trap the crash. You have now made a ²crash node. You can
  905. than use 'debug t' with the crash node or with the crashed task to
  906. start debugging at the 'ILLEGAL' instruction.
  907.  
  908. =========================== The other commands ===============================
  909.  
  910. Here follows a summary of what you can do with all debug commands :
  911.  
  912.    break n <address>    Set 'N'ormal breakpoint.
  913.                         The breakpoint is not removed after breaking
  914.    break t <address>    Set 'T'emporary breakpoint.
  915.                         The breakpoint is removed after breaking
  916.    break p <address>    Set 'P'rofile breakpoint
  917.                         This breakpoint never breaks. It only increments
  918.                         the usagecounter. You can use it to see if a
  919.                         certain routine is much used
  920.    break a <address> <timeout>
  921.                         Break 'A'fter <timeout> passes.
  922.                         The breakpoint is removed after breaking
  923.    break c <address> <condition>
  924.                         'C'onditional breakpoint. This breakpoint breaks when
  925.                         the condition is true. The breakpoint is not removed
  926.                         after breaking
  927.    break r <breakpoint number>
  928.                         Remove a breakpoint
  929.    debug n              Wait for 'N'ext prorgram
  930.    debug l <filename>   'L'oad a program and load symbols
  931.    debug t <task>|<crash node>
  932.                         Take an existing task or crash node and make
  933.                         a debug node for it. With this command you can
  934.                         in theory debug any task in the system (be
  935.                         careful though)
  936.    debug f              Remove the current debug node and freeze the
  937.                         debug task
  938.    debug f <debug node> Remove the specified debug node and freeze the
  939.                         corresponding task. Use this command if you are
  940.                         debugging multiple programs at the same time.
  941.                         You can find all debug nodes in the 'dbug' list
  942.    debug r              Remove the current debug node. The debug task
  943.                         will continue executing at the programcounter
  944.    debug r <debug node> Remove the specified debug node
  945.    debug d <name>       Create a ³dummy debug node with name <name>.
  946.                         You can't use this node for debugging but you
  947.                         can use it to create ¹symbols
  948.    drefresh             Refresh the ²debug display
  949.    dscroll <offset>     Scroll <offset> bytes up in the fullscreen debugger.
  950.                         Negative values are allowed. <offset> will be made
  951.                         a multiple of two.
  952.    dstart <address>     Set the start of the debug logical window.
  953.    duse <debug node>    Set the default debug node. This is useful when
  954.                         you are debugging multiple tasks at the same time.
  955.    dwin                 Open/Close 'Debug' logical window
  956.    symbol l <filename> [<hunkaddress>]
  957.                         ³Load the symbols for the current debug task.
  958.                         If you give <hunkaddress>, PowerVisor will load the
  959.                         symbols for the given ¹hunks. This is extremely
  960.                         useful when you have created a ³dummy debug task.
  961.                         Note that <hunkaddress> is 4 more than the number
  962.                         given in the hunklist with the 'hunks' command.
  963.                         Note that <hunkaddress> is not optional when you are
  964.                         loading symbols for a dummy debug task.
  965.    symbol c             Clear all symbols for the current debug node
  966.    symbol a <symbolname> <value>
  967.                         Add a symbol to the list of symbols
  968.    symbol r <symbolname>
  969.                         Remove a symbol from the list of symbols
  970.    symbol s             List all symbols for the current debug node
  971.    trace                Trace one instruction (singlestep mode)
  972.    trace n <number>     Trace <number> instructions (singlestep mode)
  973.    trace b              Trace until the next change of program flow
  974.                         (singlestep mode)
  975.    trace t              Trace over JSR or BSR. IF the instruction is
  976.                         not a BSR or JSR this command is analogous to
  977.                         'trace' (execute mode)
  978.    trace j              Trace until a library ROM function is about
  979.                         to be called with JMP ...(a6) or JSR ...(a6).
  980.                         (singlestep mode)
  981.    trace r <register>   Trace until a specified register is changed.
  982.                         Register can be d0-d7, a0-a6 or sp.
  983.                         (singlestep mode)
  984.    trace u <address>    Trace until programcounter is equal to <address>.
  985.                         This command works by setting a temporary
  986.                         breakpoint (number 0) at <address>. This command
  987.                         only works when <address> is not in ROM
  988.                         (execute mode)
  989.    trace ut <address>   Trace until programcounter is equal to <address>.
  990.                         No breakpoint is set by this command. <address>
  991.                         can be in ROM
  992.                         (singlestep mode)
  993.    trace o              Trace over the current instruction. This command
  994.                         is analogous to 'trace u' with <address> equal
  995.                         to the instruction following the current instruction
  996.                         (execute mode)
  997.    trace ot             Trace over the current instruction.
  998.                         This version can be used in ROM
  999.                         (singlestep mode)
  1000.    trace c <condition>  Trace until <condition> is true
  1001.                         (singlestep mode)
  1002.    trace s              Skip instruction
  1003.    trace i              Do not trace. Show the current registers and
  1004.                         instructions (obsolete in the fullscreen debugger)
  1005.    trace g              Trace until a breakpoint is encountered (note that
  1006.                         all previous trace commands also stop when a
  1007.                         breakpoint is encountered)
  1008.                         (execute mode)
  1009.    trace gt             Trace until a breakpoint is encountered
  1010.                         (singlestep mode)
  1011.    trace h              Interrupt the tracing or executing of the
  1012.                         current debug task
  1013.    trace f              Interrupt the tracing or executing of the
  1014.                         current debug task as soon as this task
  1015.                         is in ready state
  1016.    with <debug node> <command>
  1017.                         Temporarily set the current debug node and execute
  1018.                         <command>. This is useful for example, if you are
  1019.                         debugging with multiple programs at the same time and
  1020.                         you want to have a look at the symbols or registers
  1021.                         of the other program
  1022.  
  1023.