home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / tddoc.pak / TD_HDWBP.TXT < prev    next >
Text File  |  1997-07-23  |  10KB  |  224 lines

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