home *** CD-ROM | disk | FTP | other *** search
/ EDUCORP 8 / Educorp2Compilation.sit / educorp2 / Demos / Aztec Source Level Debugger / demo / datest.r < prev    next >
Encoding:
Text File  |  1988-06-24  |  4.0 KB  |  106 lines

  1. p @"This demo is designed to show how sdb may be used to debug"
  2. p @"desk accessories and drivers.  If you aren't already familiar"
  3. p @"with the basic use of sdb, you should first run the count demo."
  4. p @"To invoke it from the finder, just double click on the"
  5. p @"count.dbg icon."
  6. p @" "
  7. p @"You can terminate this session by entering a Ctrl-C or Cmd-C"
  8. p @"to gain control of sdb, and than a q at the sdb prompt."
  9. p @" "
  10. &
  11. p @"This demo requires the Explorer desk accessory to be installed"
  12. p @"in the currently active system file.  If you booted from"
  13. p @"the demo disk, it's already been done for you.  If not, you"
  14. p @"need to terminate this session and use the Font D/A Mover to"
  15. p @"install explor."
  16. p @" "
  17. &
  18. p @"At this point sdb has been invoked with no program loaded."
  19. p @"This is important, since the alternate .dbg file for the"
  20. p @"desk accessory must be loaded before a program is launched."
  21. p @"Let's do that now with the ala command.  We'll be working"
  22. p @"with the DA called explor which is one of the example programs"
  23. p @"included on your Aztec C disks."
  24. p @" "
  25. &
  26. oe
  27. ala explor
  28. oe
  29. p @" "
  30. p @"The .dbg file for the desk accessory has been loaded."
  31. p @"It's now necessary to load a primary application from"
  32. p @"which the desk accessory may be exercised.  In this case"
  33. p @"we'll use datest, a skeleton application to put up the"
  34. p @"Apple menu to access desk accessories along with a File"
  35. p @"menu with a Quit command.  To load it we use the lp command."
  36. p @" "
  37. &
  38. oe
  39. lp datest
  40. oe
  41. p @"The datest application has been loaded and we're viewing it's"
  42. p @"source.  It now remains for us to load the actual desk accessory."
  43. p @"This resource must be in the system file in order to be loaded"
  44. p @"and debugged.  The command ald followed by the resource type and"
  45. p @"name or id number is used to load the desk accessory into memory."
  46. p @" "
  47. &
  48. oe
  49. ald DRVR Explorer
  50. oe
  51. p @" "
  52. p @"As you can see, the ald command is generic enough to handle other"
  53. p @"things such as drivers and even other resource types such as FKEYs."
  54. p @"We now have the desk accessory loaded, but are still viewing datest,"
  55. p @"the primary application.  To switch the context of sdb to view and"
  56. p @"debug the desk accessory, we'll need to use the ax command."
  57. p @" "
  58. &
  59. oe
  60. ax
  61. oe
  62. p @" "
  63. p @"Now that the labels have been changed to those of the desk accessory,"
  64. p @"we'll view and set breakpoints in explor.  Let's look at the routine"
  65. p @"open() which is called early on when the desk accessory is selected."
  66. p @" "
  67. &
  68. oe
  69. df open
  70. oe
  71. p @"As you can see, we're now viewing the source for explor.  But although"
  72. p @"we're viewing the source for explor, the PC indicates that we're still"
  73. p @"in datest.  To remedy that we'll set a breakpoint on open and let"
  74. p @"datest run.  That way sdb will regain control when the desk accessory"
  75. p @"is selected."
  76. p @" "
  77. &
  78. oe
  79. bs open
  80. oe
  81. p @"Now we're all set to enter the desk accessory.  The only thing that"
  82. p @"remains is for us to enter a g to go.  Having done that, the application"
  83. p @"datest will be running and you'll be in control.  To reenter sdb"
  84. p @"you will need to open the desk accessory explor by selecting it from"
  85. p @"the apple menu.  At that point sdb under the control of this command"
  86. p @"file will take over again."
  87. p@" "
  88. &
  89. oe
  90. g
  91. oe
  92. p @"OK, you've succesfully entered the desk accessory and can see by the"
  93. p @"highlighted line in the source file that we're ready to execute the"
  94. p @"open function.  Now that you're in the desk accessory, the use of sdb"
  95. p @"to step through and debug it is virtually identical to debugging a"
  96. p @"primary application.  In most cases when debugging a desk accessory, you"
  97. p @"won't need to worry about the primary application that has invoked it."
  98. p @"But if for some reason you should need to return to it, sdb still has"
  99. p @"the necessay .dbg information to do that.  To do it, you'd execute"
  100. p @"the ax command a second time and set the necessary breakpoints."
  101. p@" "
  102. &
  103. p @"Since the purpose of this demo was to show you how to load and enter"
  104. p @"a desk accessory we'll stop here and let you take over."
  105. p @n"The command file has now terminated, and you're in control."
  106.