home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / educ / cvtutor.zip / CODEVIEW.DOC < prev    next >
Text File  |  1987-08-13  |  14KB  |  415 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. === The Sample Disk ===
  8.  
  9. The CodeView (TM) sample disk is freely copyable as long as the
  10. programs and files on the disk are not modified. You may give
  11. the disk to friends, upload it to electronic bulletin boards, or
  12. distribute it through computer clubs. However, you may not sell
  13. the sample disk for profit. User groups may charge a fee to
  14. cover the actual cost of the disk and of administration.
  15.  
  16. The version of the CodeView debugger on this disk has been
  17. disabled so that it works only with the sample programs
  18. provided on the disk. To distinguish it from the commercial
  19. version, the restricted debugger file is called CVR.EXE rather
  20. than CV.EXE.
  21.  
  22. Do not alter the sample programs on the disk, since this will
  23. make the sample session nonoperational. However, the sample
  24. programs are in the public domain. You may modify and
  25. recompile the source code after copying the files to another
  26. disk. Do not distribute modified programs with the sample
  27. disk.
  28.  
  29.        Copyright (C) Microsoft Corporation 1986
  30.               All Rights Reserved
  31.  
  32.  
  33.  
  34. === Starting the CodeView Debugger ==
  35.  
  36. The syntax for starting the restricted version of the debugger
  37. is shown below:
  38.  
  39.      CVR [<options>] <executablefile> [<arguments>]
  40.  
  41. The CodeView start-up options are shown in the table below:
  42.  
  43.      Option        Effect
  44.      ------        ------
  45.      /B         Starts in black-and-white mode
  46.             with color graphics adapter (CGA).
  47.  
  48.      /C<commands>    Executes commands on start-up.
  49.  
  50.      /F         Starts with screen flipping (exchanges
  51.             screens by flipping video pages).
  52.  
  53.      /M         Disables the mouse.
  54.  
  55.      /T         Starts in sequential mode.
  56.  
  57.      /S         Starts with screen swapping (exchanges
  58.             screens by swapping buffers).
  59.  
  60.      /W         Starts in window mode.
  61.  
  62.      /43        Starts in 43-row mode with an
  63.             enhanced graphics adapter (EGA).
  64.  
  65.      /2         Allows two video adapters. You must have
  66.             two video adapters and two monitors. The
  67.             program display appears on the current default
  68.             adapter and monitor, while the debugging
  69.             display appears on the other adapter and
  70.             monitor. For example, if you have both a color
  71.             graphics adapter and a monochrome adapter, you
  72.             might want to set the CGA up as the default
  73.             adapter. You could then debug a graphics
  74.             program with the graphics display appearing on
  75.             the graphics monitor and the debugging display
  76.             appearing on the monochrome adapter. Microsoft
  77.             Mouse support will be disabled on the
  78.             debugging display if you use this option.
  79.  
  80.      /D         Turns off certain IBM-specific functions,
  81.             including NMI trapping and 8259 masking. This
  82.             option is required for IBM-compatible machines
  83.             that do not support these functions, such as
  84.             the IBM PC Convertible, the Tandy 1000, and
  85.             the AT&T 6300 Plus. CONTROL-C and CONTROL-
  86.             BREAK do not work if this option is used.
  87.             Sequential mode is set automatically; use /W
  88.             with /D to enable window mode.
  89.  
  90.  
  91.      /I         Forces the debugger to handle certain IBM-
  92.             specific functions, including NMI trapping and
  93.             8259 masking. This option can be used to
  94.             enable CONTROL-C and CONTROL-BREAK handling on
  95.             computers that the debugger does not recognize
  96.             as being IBM compatible, such as the Eagle PC.
  97.             Window mode is set automatically; you do not
  98.             have to specify /W.
  99.  
  100. If you have an IBM Personal Computer, the system always starts
  101. in window mode. Screen flipping is used if you have a graphics
  102. adapter and monitor.  Screen swapping is used if you have a
  103. monochrome adapter and monitor.
  104.  
  105. If you have an IBM-compatible computer, you will usually want to
  106. specify the options that are used automatically with the IBM PC.
  107.  
  108. If your computer is not IBM compatible, you will not be able to
  109. use the CodeView debugger in window mode. You must specify /T to start
  110. in sequential mode. Sequential mode is not as convenient, but any
  111. debugging operation that can be done in window mode can also be done
  112. in sequential mode. You will not be able to use a mouse or menus in
  113. sequential mode, but you can use most function keys.
  114.  
  115.  
  116.  
  117. === CodeView Quick Start ===
  118.  
  119. If you are familiar with previous Microsoft (R) debuggers (SYMDEB
  120. or DEBUG), you will have little trouble using the CodeView debugger.
  121.  
  122. Once the CodeView display appears, you can start debugging. The primary
  123. CodeView debugging commands are the same or very similar to the ones
  124. used in SYMDEB and DEBUG. The most important commands common to both
  125. the CodeView debugger and SYMDEB are listed below (all but the last
  126. two are also available in DEBUG):
  127.  
  128.      If You Want to:        Do This:
  129.      ---------------        --------
  130.      Quit the debugger        Enter Q.
  131.  
  132.      Execute code a step    Enter T (for Trace) or P (for
  133.      at a time            Program Step).
  134.  
  135.      Execute your program    Enter G (for Go).
  136.  
  137.      Set a breakpoint        Enter BP (for Breakpoint Set)
  138.                 followed by an address. An easy
  139.                 way of specifying an address is
  140.                 to type a dot followed by the
  141.                 number of the source line where
  142.                 the breakpoint will be. For
  143.                 example, to set a breakpoint on
  144.                 line 25, enter
  145.  
  146.                        BP .25
  147.  
  148.      Dump a portion of memory    Enter D (for Dump) followed by the
  149.                 address where you want the dump to
  150.                 start. For example, enter
  151.  
  152.                        D DS:100
  153.  
  154.      Examine a variable or    Enter ? followed by the variable or
  155.      expression         expression. For example, to view
  156.                 the sum of sym1 and sym2 divided by
  157.                 the constant 3, enter
  158.  
  159.                        ? (sym1+sym2)/3
  160.  
  161.      View source code        Enter V followed by a dot and the
  162.                 number of the first source line to be
  163.                 viewed. For example, to view source
  164.                 code starting at line 36, enter
  165.  
  166.                        V .36
  167.  
  168.  
  169.  
  170. Two differences between the CodeView debugger and previous Microsoft
  171. debuggers may be confusing at first. The command for getting a summary
  172. help screen is H, not ? as in the earlier debuggers. Also, the
  173. CodeView debugger expects initial input in decimal, not in
  174. hexadecimal. You can enter hexadecimal numbers in the FORTRAN format (for
  175. example, #3CC2). You can also change the radix to hexadecimal or
  176. octal using the Radix command (for example, N16 for hexadecimal).
  177.  
  178. If you do not have an IBM or IBM-compatible computer, this may be all
  179. the information you need to start experimenting. If you have an IBM
  180. Personal Computer or a compatible computer capable of using CodeView's
  181. window mode, there are easier ways of doing many of the tasks shown
  182. above.
  183.  
  184. The table below concentrates on methods of executing commands from
  185. the keyboard, but the mouse versions of some commands are also
  186. mentioned:
  187.  
  188.      If You Want to:        Do This:
  189.      ---------------        --------
  190.      View on-line help        Press F1. The first menu screen
  191.                 appears. Use the mouse, menu selection
  192.                 letters, or the PGUP, PGDN, and HOME
  193.                 keys to move through the system. The
  194.                 END key gets you out of help.
  195.  
  196.      Move through your        First make sure the cursor is in the
  197.      source code        window containing source code. If
  198.                 it is not, press F6 to move the cursor
  199.                 to the correct window. Then press
  200.                 PGUP, PGDN, HOME, END, UP ARROW, or
  201.                 DOWN ARROW to move through the source
  202.                 code.
  203.  
  204.      Execute code a step    Press F8 (for Trace) or F10 (for
  205.      at a time            Program Step). If you have a mouse,
  206.                 you can click Trace! on the menu bar.
  207.                 Use the right mouse button for the
  208.                 Trace command or the left mouse button
  209.                 for the Program Step command.
  210.  
  211.      Execute your program    Press F5 (for Go). Execution stops
  212.                 only if a breakpoint is encountered.
  213.                 If you have a mouse, you can click
  214.                 Go! on the menu bar. Use either button.
  215.  
  216.  
  217.  
  218.      Execute to a specified    Move the cursor to the line to which
  219.      line of code        you want to execute (you may need to
  220.                 press F6 to switch the cursor to
  221.                 the correct window), then press
  222.                 F7. The reverse-video line marking
  223.                 the current location will move to
  224.                 that line. If you have a mouse,
  225.                 you can do the same thing by
  226.                 moving the mouse cursor to the
  227.                 source line and clicking the right
  228.                 mouse button.
  229.  
  230.      Set a breakpoint        Move the cursor to the line where
  231.                 you want the breakpoint (you may
  232.                 need to press F6 to switch the
  233.                 cursor to the correct window),
  234.                 then press F9. The source line
  235.                 will be shown in high-intensity
  236.                 text to indicate that a breakpoint
  237.                 is set. You can repeat the same
  238.                 command to remove the breakpoint.
  239.                 If you have a mouse, you can do
  240.                 the same thing by moving the mouse
  241.                 cursor to the source line and
  242.                 clicking the left mouse button.
  243.  
  244. You can also experiment with the menus listed on the top line of the
  245. display. To select from a menu with the keyboard, press the ALT key
  246. and the first letter of the menu title. A menu box listing the
  247. selections pops up. To make a selection, use the cursor keys to move
  248. the highlight to the selection you want, then press the ENTER key. You
  249. can select from an open menu by pressing the ALT key and the first
  250. letter of the selection.
  251.  
  252. To select from a menu using the mouse, move the mouse cursor to the
  253. menu title, press either mouse button, and while holding the button
  254. down, drag the highlight down to the desired selection. Then release
  255. the button.
  256.  
  257.  
  258.  
  259. === Command Summary ===
  260.  
  261. The CodeView function keys are shown on the template below. You can
  262. create an overlay that will fit some PC keyboards by printing it using
  263. 10-pitch type, then making a 73-percent photocopied reduction.
  264.  
  265.          ----------------------------------
  266.         |                   |
  267.          ----------------------------------
  268.         |     |            |       |
  269.         |Get     |            |View  |
  270.         |help     |  F1        F2  |regis-|
  271.         |     |            |ters  |
  272.         |     |            |       |
  273.         |--------             ------
  274.         |Set     |            |       |
  275.         |source  |            |View  |
  276.         |or     |  F3        F4  |output|
  277.         |assembly|            |screen|
  278.         |mode     |            |       |
  279.          --------             ------
  280.         |     |            |       |
  281.         |     |            |Change|
  282.         |Go     |  F5        F6  |cursor|
  283.         |     |            |window|
  284.         |     |            |       |
  285.         |--------             ------
  286.         |     |            |Trace |
  287.         |Go to     |            |into  |
  288.         |cursor  |  F7        F8  |func- |
  289.         |line     |            |tions |
  290.         |     |            |       |
  291.         |--------             ------
  292.         |Set     |            |Step  |
  293.         |break-  |            |over  |
  294.         |point     |  F9        F10 |func- |
  295.         |at     |            |tions |
  296.         |cursor  |            |       |
  297.          ----------------------------------
  298.         |CONTROL-U Move separator line up  |
  299.         |CONTROL-D Move separator line down|
  300.          ----------------------------------
  301.  
  302.  
  303.  
  304. The following table shows the window commands that can be
  305. executed with the mouse or function keys:
  306.  
  307.  Command              Keyboard              Mouse
  308. ---------------------------- ----------------------- ---------------------------
  309.  Open help screen        | F1            | Use View menu
  310.  Open register window        | F2            | Use Options menu
  311.  Toggle source/assembly     | F3            | Use View menu
  312.  Switch to output screen    | F4            | Use View menu
  313.  Go                | F5            | Click either on Go
  314.  Switch cursor window        | F6            | None
  315.  Go to cursor line        | F7 at location        | Click right on source line
  316.  Trace through functions    | F8            | Click left on Trace
  317.  Set breakpoint at cursor   | F9 at location        | Click left on source line
  318.  Step over functions        | F10            | Click right on Trace
  319.  Change flag            | None            | Click either on flag
  320.  Move separator line up     | CONTROL-U         | Drag line up
  321.  Move separator line down   | CONTROL-D         | Drag line down
  322.  Scroll up line in window   | Move cursor off top   | Click left on up arrow
  323.  Scroll up page in window   | PGUP            | Click right on up arrow
  324.  Scroll to top of window    | HOME            | Click both on up arrow
  325.  Scroll down line in window | Move cursor off bottom| Click left on down arrow
  326.  Scroll down page in window | PGDN            | Click right on down arrow
  327.  Scroll to bottom of window | END            | Click both on down arrow
  328.  Move cursor            | UP ARROW or DOWN ARROW| None
  329. ---------------------------- ----------------------- ---------------------------
  330.  
  331.  
  332.  
  333. The syntax for each of the CodeView dialog commands is listed below.
  334. The commands are listed in groups according to their functions:
  335.  
  336. Execute Code
  337.  
  338.    Command         Syntax
  339.    -------         ------
  340.    Trace         T [<count>]
  341.    Program Step      P [<count>]
  342.    Go             G [<address>]
  343.    Execute         E
  344.    Restart         L [<arguments>]
  345.  
  346. Examine Data
  347.  
  348.    Command         Syntax
  349.    -------         ------
  350.    Display Expression     ? <expression>[,format]
  351.    Examine Symbols     X?[mod!][fun.][sym][*]
  352.    Dump          D[<type>] [<range>]
  353.    Register         R [<reg>] [[=]<expression>]
  354.    8087 Dump         7
  355.  
  356. Breakpoints
  357.  
  358.    Command         Syntax
  359.    -------         ------
  360.    Breakpoint Set     BP [<address>] [<count>] ["<command>"]
  361.    Breakpoint Clear     BC [<list>]
  362.    Breakpoint Disable     BD [<list>]
  363.    Breakpoint Enable     BE [<list>]
  364.    Breakpoint List     BL
  365.  
  366. Watch Statements
  367.  
  368.    Command         Syntax
  369.    -------         ------
  370.    Watch         W? <expression>
  371.    Watch         W[<type>] <range>
  372.    Watchpoint         WP? <expression>
  373.    Tracepoint         TP? <expression>
  374.    Tracepoint         TP[<type> <range>
  375.    Delete Watch      Y<list>
  376.  
  377. Examine Source
  378.  
  379.    Command         Syntax
  380.    -------         ------
  381.    Set Mode         S[+|-|&]
  382.    Unassemble         U [<range>]
  383.    View Source         V [<address>]
  384.    Current Location     .
  385.    Stack Trace         K
  386.  
  387. Modify
  388.  
  389.    Command         Syntax
  390.    -------         ------
  391.    Assemble         A [<address>]
  392.    Enter         E[<type>] [<list>]
  393.  
  394. System Control
  395.  
  396.    Command         Syntax
  397.    -------         ------
  398.    Set Radix         N[<radix>]
  399.    Quit          Q
  400.    Search         /[<regex>]
  401.    Screen Exchange     \
  402.    Tab Set         #[<num>
  403.  
  404. Redirection
  405.  
  406.    Command         Syntax
  407.    -------         ------
  408.    Send Output         [T]>[>]<device>
  409.    Get Input         <<device>
  410.    Redirect Both     =<device>
  411.    Pause         "
  412.    Delay         :
  413.    Comment         *[<comment>]
  414.  
  415.