home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 6.ddi / DOC.ZIP / HDWDEBUG.TD < prev    next >
Encoding:
Text File  |  1992-06-10  |  8.6 KB  |  207 lines

  1. /*************************************************************************/
  2.                              TURBO DEBUGGER 
  3.                    USING THE HARDWARE DEBUGGING FEATURES
  4.  
  5.  
  6. CONFIGURING YOUR SYSTEM
  7. =======================
  8.  
  9. Before you can do hardware debugging, you must either have loaded
  10. TDH386.SYS (for DOS debugging) or TDDEBUG.386 (for Windows debugging).
  11. See Chapter 1 of the "Turbo Debugger User's Guide" to find out how
  12. to load these programs.
  13.  
  14.  
  15. SETTING HARDWARE BREAKPOINTS
  16. ============================
  17.  
  18. There are several ways to set a hardware-assisted breakpoint:
  19.  
  20. o Choose Breakpoints|Changed memory global. 
  21.  
  22.     In the input box of the dialog box that opens, enter a memory 
  23.     address followed by the number of bytes Turbo Debugger is to 
  24.     watch to determine if your program has changed anything in that
  25.     part of memory.  If you enter a variable name or expression as 
  26.     the address, the count refers to how many objects of that size 
  27.     to watch.
  28.     
  29.     For example, if your program contains a word-sized variable x, 
  30.     typing "x,2" causes two objects of size sizeof(x) (4 bytes total)
  31.     to be watched.
  32.  
  33.     When you set a breakpoint using the Changed Memory Global command, 
  34.     Turbo Debugger automatically determines whether that breakpoint 
  35.     can make use of the available hardware.  If it can, Turbo Debugger
  36.     sets a hardware breakpoint for you and indicates that the breakpoint 
  37.     is set in hardware by putting an asterisk (*) after the global 
  38.     breakpoint number in the left pane of the Breakpoints window.
  39.  
  40. o Choose Breakpoints|Hardware Breakpoint.
  41.  
  42.     Use this command to set a general-purpose hardware breakpoint. This 
  43.     command displays the Hardware Breakpoint Options dialog box (described
  44.     later).
  45.  
  46. o Use the Breakpoint Options dialog box (see the paragraphs after the next
  47.   one for an explanation of how to display this dialog box) to get to the 
  48.   Hardware Breakpoint options dialog box (described later).
  49.  
  50.     In the Breakpoint Options dialog box, check the Global checkbox, then
  51.     press the Change button to display the Conditions and Actions dialog
  52.     box. In this dialog box, select the Hardware radio button in the
  53.     Condition group, then press the Hardware button at the bottom of the 
  54.     box to display the Hardware Breakpoint Options dialog box.
  55.  
  56.     You can get to the Breakpoint Options dialog box from two locations:
  57.     the Breakpoints menu or the Breakpoints view window.
  58.  
  59.     - Choose Breakpoints|At (Alt-B A) to display the Breakpoint Options
  60.       dialog box.
  61.  
  62.     - Choose View|Breakpoints to display the Breakpoints window. In the left
  63.       pane, highlight the breakpoint you want to work with, then display the
  64.       local menu (Alt-F10 or right-hand mouse click) and choose the Set
  65.       Options or the Add command to display the Breakpoint Options dialog box.
  66.  
  67.  
  68. USING THE HARDWARE BREAKPOINT OPTIONS DIALOG BOX
  69. ================================================
  70.  
  71. This section starts with a description of the hardware and software 
  72. limitations on the hardware conditions you can set with Turbo Debugger,
  73. and then explains all the options you can set from the Hardware 
  74. Breakpoints Dialog box.
  75.  
  76.  
  77. Hardware conditions permitted with TDH386.SYS and TDDEBUG.386
  78. -------------------------------------------------------------
  79.  
  80. When you're using TDH386.SYS with Turbo Debugger or TDDEBUG.386 with 
  81. Turbo Debugger for Windows, you can set the following types of hardware 
  82. breakpoints from the Hardware Breakpoint dialog box:
  83.  
  84. o instruction fetch
  85.  
  86. o read from memory
  87.  
  88. o write to memory
  89.  
  90. o access memory
  91.  
  92. Because you can't set any type of data matching when you use TDH386.SYS
  93. or TDDEBUG.386, you must always set the Data Match radio buttons to 
  94. Match All. You can also match only a single memory address or range of 
  95. memory addresses. A range can encompass from 1 to 16 bytes, depending on 
  96. how many other hardware breakpoints you have set and the address of the 
  97. beginning of the range.
  98.  
  99. The other options in the Hardware Breakpoint dialog are for other hardware 
  100. debuggers and device drivers that might support more matching modes.
  101.  
  102. You can also use TDH386.SYS with Turbo Debugger and with the virtual
  103. debugger (TD386). In this case, you can use many more types of
  104. hardware breakpoints, including matching on any size ranges of memory
  105. or I/O access.
  106.  
  107.  
  108. The Hardware Breakpoint Options dialog box
  109. ------------------------------------------
  110.  
  111. This section describes the options on the Hardware Breakpoint Options 
  112. dialog box. Remember that your hardware isn't likely to support 
  113. all combinations of matching that you can specify from this menu. The 
  114. previous section describes the combinations that are allowed for the 
  115. TDH386.SYS and TDDEBUG.386 device drivers supplied with Turbo Debugger.
  116.  
  117. The Hardware Breakpoint Options dialog box lets you set the three matching
  118. criteria that make up a hardware breakpoint:
  119.  
  120. o the bus cycle type to be matched
  121.  
  122. o the range of addresses to be matched
  123.  
  124. o the range of data values to be matched
  125.  
  126. For example, a hardware breakpoint might say "Watch for an I/O write
  127. anywhere from address 3F8 to 3FF as long as the data value is equal to
  128. 1." This breakpoint will then be triggered any time a byte of 1 is
  129. written to any of the I/O locations that control the COM1 serial port.
  130.  
  131. Usually, you set far simpler hardware breakpoints than this, such
  132. as "Watch for I/O to address 200."
  133.  
  134.   Cycle Type radio buttons
  135.   ------------------------
  136.  
  137.     With these radio buttons, you can make one of the following settings:
  138.  
  139.     Read Memory          Match memory reads
  140.     Write Memory         Match memory writes
  141.     Access Memory        Match memory read or write
  142.     Input I/O            Match I/O input
  143.     Output I/O           Match I/O Output
  144.     Both I/O             Match I/O input or output
  145.     Fetch Instruction    Match instruction fetch
  146.  
  147.     The Access Memory option is a combination of the Read Memory and Write
  148.     Memory options--it matches either memory reads or writes. Likewise,
  149.     the Both I/O option matches I/O reads or writes.
  150.  
  151.     Some hardware debuggers are capable of distinguishing between simple
  152.     data reads from memory and instruction fetches. In this case, if you
  153.     set a breakpoint to match on read memory, an instruction fetch from
  154.     that location will not trigger the hardware breakpoint. Instruction
  155.     cycles include all the bytes that the processor reads in order to
  156.     determine the instruction operation to perform, including prefix
  157.     bytes, operand addresses, and immediate values. The actual data read
  158.     or written to memory referenced by an operand's address is not
  159.     considered to be part of the instruction fetch. For example,
  160.  
  161.       MOV    AX,[1234]
  162.  
  163.     fetches 3 instruction bytes from memory and reads 2 data bytes. If you
  164.     use instruction fetch matching, remember that the 80x86 processor
  165.     family prefetches instructions to be executed, so you may get false
  166.     matches, depending on whether your hardware debugger can sort out
  167.     prefetched instructions from ones that are really executed.
  168.  
  169.   Address radio buttons
  170.   ---------------------
  171.  
  172.     With these radio buttons, you can make one of the following settings:
  173.  
  174.     Above              Match above an address
  175.     Below              Match below an address
  176.     Range              Match within address range
  177.     Not Range          Match outside address range
  178.     Less or Equal      Match below or equal to address
  179.     Greater or Equal   Match above or equal to address
  180.     Equal              Match a single address
  181.     Unequal            Match all but a single address
  182.     Match All          Match any address
  183.  
  184.  
  185.   Data Match radio buttons
  186.   ------------------------
  187.  
  188.     The Data Match radio buttons let you make the following settings:
  189.     
  190.     Above              Match above a value
  191.     Below              Match below a value
  192.     Range              Match within value range
  193.     Not Range          Match outside value range
  194.     Less or Equal      Match below or equal to value
  195.     Greater or Equal   Match above or equal to value
  196.     Equal              Match a single value
  197.     Unequal            Match all but a single value
  198.     Match All          Match any value
  199.     
  200.     If you turn on a Data or Address option that involves any less-than or
  201.     greater-than condition, a single address match range either starts at
  202.     zero and extends to the value you specified, or starts at the value
  203.     you specified and extends to the highest allowed value for addresses
  204.     or data.
  205.  
  206. /***************************** END OF FILE *******************************/
  207.