home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_200 / 228_01 / cwindemo.doc < prev    next >
Text File  |  1987-07-31  |  25KB  |  658 lines

  1. C-window Demonstration     Copyright  (C) 1983 by c-systems
  2.  
  3.  
  4.  
  5.  
  6.              C-window Demonstration Document File
  7.              ------------------------------------
  8.  
  9.  
  10.  
  11. Do it NOW!
  12. ----------
  13.  
  14.       This file  shows how    to use    the c-window  DEMO provided in
  15.       Diskette B.
  16.  
  17.       Print this file and the file "dump.c" (also on Diskette  B),
  18.       as constant reference will be made to them in this document.
  19.  
  20. Overview
  21. --------
  22.  
  23.       C-window(tm) is used to debug C programs at the  source-code
  24.       level.   C-window   provides     an   interactive    debugging
  25.       environment that simplifies the program development process.
  26.  
  27.       C-window commands can:
  28.  
  29.           o  set  breakpoints  at  a  function  name and
  30.          source-code line,
  31.  
  32.           o  single   step     and   trace   at   the    C
  33.          source-statement level,
  34.  
  35.           o  display the value  of variables, using  the
  36.          same variable names as used in the C source
  37.          code (Local and external are supported),
  38.  
  39.           o  display  the  source  code  of  the program
  40.          under test,
  41.  
  42.           o  display complex expressions, like the third
  43.          element of an array of characters, which is
  44.          a  member  of    a  structure,  which  is  an
  45.          element in an array of structures, and
  46.  
  47.           o  override minor  program bugs  allowing more
  48.          of  the  program  to  be  tested  before  a
  49.          recompilation is needed.
  50.  
  51.  
  52.       To  use  the    c-window  debugger,  the  source  code must be
  53.       compiled using the "-w" option of the c-systems C  compiler.
  54.       During the link step the object code library,  c-window.lib,
  55.       is included,    which embeds  the c-window  executive into the
  56.       executable  object  file.  When  the    final  test  module is
  57.       invoked, the c-window  executive is actually    given control,
  58.       not the program being tested.
  59.  
  60. The Programs Dump.C and Dump.Exe
  61. --------------------------------
  62.  
  63.       Dump.c is the source code  for a dump utility that  dumps an
  64.       ASCII file in both hex. and ASCII format, while showing  the
  65.       address  of  the  data  in  the file. The executable module,
  66.       "dump.exe" is also contained on Diskette B.
  67.  
  68.       To study the output of this program, type:
  69.  
  70.  
  71.       A>dump dump.c
  72.  
  73.  
  74.       (For the purposes  of this DEMO  package we assume  that all
  75.       files mentioned are available on drive A.)
  76.  
  77.       The program reads the  input file dump.c and    displays three
  78.       fields  on  the  monitor.  The  leftmost  field contains the
  79.       starting address  of the  data displayed.  The middle  field
  80.       contains  the  hex.  representation  of  the    file,  and the
  81.       rightmost  field  contains  the  ASCII representation of the
  82.       hex. data. Periods are  displayed in the rightmost  field to
  83.       represent extended-ASCII characters.
  84.  
  85. C-window Demonstration Program
  86. ------------------------------
  87.  
  88.       I suggest that  you review the  "dump.c" source code  before
  89.       proceeding with this DEMO.
  90.  
  91.       The DEMO program,"cwdump.exe", is also contained on Diskette
  92.       B. Assuming it is on drive A, type
  93.  
  94.  
  95.    A>cwdump dump.c
  96.  
  97.  
  98.       to start the DEMO.
  99.  
  100.       If you  are using  an IBM-PC    or compatible,    the screen  is
  101.       divided into three sections.    These sections are treated  as
  102.       independent  windows    by  the  c-window  executive.  The top
  103.       window is  the debugger  interface. All  commands issued and
  104.       responses received are displayed within the top window.  The
  105.       middle window is dedicated to the application keyboard input
  106.       and screen output. The hex.  dump that you saw when  you ran
  107.       "dump.exe" will  appear only  within this  window. The  last
  108.       window, at  the bottom  of the  screen, displays  the source
  109.       code of the file being  debugged. Whenever a single step,  a
  110.       trace, or a breakpoint occurs the last window is updated  to
  111.       show    the  results  of  the  instruction.  This  allows  for
  112.       debugging at the  source level without  the need to  reprint
  113.       the source code each time a source code change is made.
  114.  
  115.       When    the  program  begins  execution  a  message  is issued
  116.       indicating the  function name  ("main") and  the line number
  117.       where execution begins. The message
  118.  
  119.  
  120.    entry at main line 22
  121.    >>
  122.  
  123.  
  124.       should appear in the    top window, showing that  execution of
  125.       the program under test started in the function named    "main"
  126.       at line 22. The ">>" is the c-window command-line prompt and
  127.       indicates that c-window is waiting for a command. C-window's
  128.       response to your command is not preceded by the ">>' prompt,
  129.       so you can easily tell them apart.
  130.  
  131.       To exit the DEMO, type "ex" after the ">>' prompt  displayed
  132.       in the top window.
  133.  
  134.       As  our  first  command  to  the debugger, let's display the
  135.       arguments passed  into the  "main" function  (i.e. argc  and
  136.       argv). The command
  137.  
  138.  
  139.    >>d argc
  140.    2
  141.  
  142.  
  143.       displays the number of parameters typed on the command  line
  144.       when the program was invoked. The "2" shown on the next line
  145.       is c-window's response to this command.
  146.  
  147.       To display the parameter entered on the command line, type:
  148.  
  149.  
  150.    >>ds argv[1]
  151.    dump.c
  152.  
  153.  
  154.       The <ds> command tells  c-window to display "argv[1]"  using
  155.       the string  format, and  indeed C-window's  response to  the
  156.       command  matches  the  command-line  entry  used  to    invoke
  157.       "cwdump.exe"
  158.  
  159.       We saw earlier  that "argc" was  equal to 2.  On line 22  of
  160.       "dump.c" an "if" statement checks  to see if "argc" is  less
  161.       than 2.  Since "argc"  is not  less than  2, we  expect that
  162.       lines 23, 24, and 25    (the body of the "if"  statement) will
  163.       be  skipped  and  execution  resumed    at  line 26, the first
  164.       statement after the  "if" statement. C-window`s  single step
  165.       command is used below. Let's see what happens.
  166.  
  167.  
  168.    >>s
  169.    step at main line 26
  170.  
  171.  
  172.       Sure enough. The body of the "if" statement was skipped  and
  173.       line 26 will be executed next.
  174.  
  175.       The "if" statement on line  26 tries to open the  file named
  176.       in argv[1] ("dump.c") and then checks the value returned  by
  177.       "fopen" to  see if  any errors  were detected.  Let's single
  178.       step again and look at the results.
  179.  
  180.  
  181.    >>s
  182.    step at main line 30
  183.  
  184.  
  185.       C-window's response shows that no errors were detected since
  186.       line 27 and  28 were skipped.  The pointer "infp"  now holds
  187.       the file pointer that will  be used for all subsequent  file
  188.       operations on "dump.c".
  189.  
  190.       The "if" statement on line 30 checks if an output file  name
  191.       was entered on the command line of "cwdump" and also  checks
  192.       that the output file is not the same file as the input file.
  193.  
  194.  
  195.    >>s
  196.    step at main line 37
  197.  
  198.  
  199.       As  no  output  file    was  typed  on    the  command line when
  200.       "cwdump.exe" was executed "argc"  is not greater than  2. So
  201.       lines 31, 32, and 33 were  skipped, and line 37 is the  next
  202.       line to  be executed.  Line 37  assigns the  console to  the
  203.       output file pointer so subsequent output done by the program
  204.       will go to the console screen.
  205.  
  206.       Now let's set a non-sticky breakpoint using the <g> command.
  207.       (go command).  This breakpoint  will be  set at  line 40  of
  208.       function "main". This line  follows the code that  reads the
  209.       first 16 bytes of "dump.c".
  210.  
  211.  
  212.    >>g main,40
  213.    break at main line 40
  214.  
  215.  
  216.       Execution begins at the current location and stops when line
  217.       40 in "main"  is to be  executed. C-window's response  shows
  218.       where  the  breakpoint  occurred.  The  number  of  elements
  219.       actually read from  the file, in  "nread", can be  displayed
  220.       using the command:
  221.  
  222.  
  223.    >>d nread
  224.    10
  225.  
  226.  
  227.       The <d> command indicates to display the variable "nread" in
  228.       hex. format  (Any C  expression can  be displayed,  not just
  229.       simple variables.) So "nread"  = 0x10 or 16  decimal. Notice
  230.       that you typed "nread", the same name declared in the source
  231.       code. This is symbolic debugging. The value of "nread" shows
  232.       that 16 bytes were read from "dump.c"
  233.  
  234.       Alternately, to display the contents of "nread" in  decimal,
  235.       use:
  236.  
  237.  
  238.    >>dd nread
  239.    16
  240.  
  241.  
  242.       Let's look at the data that was read from "dump.c". Since we
  243.       know that this  data was placed  into a buffer  with address
  244.       "buf", to  display the  data in  a byte-format  memory dump,
  245.       use:
  246.  
  247.  
  248.    >>db buf
  249.    66a0 : 2f 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  /***************
  250.    66b0 : 10 00 02 00 70 04 06 48 82 00 00 01 c7 13 02 00  ....p..H........
  251.    66c0 : d4 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .G..............
  252.    66d0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  253.    66e0 : 00 64 75 6d 70 2e 63 00 00 00 00 00 00 00 00 00  .dump.c.........
  254.    66f0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  255.    6700 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  256.    6710 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  257.  
  258.  
  259.  
  260.       As 16  bytes have  been read    from "dump.c",  only the  data
  261.       between addresses 66a0 and 66af, inclusive, are of  interest
  262.       to us at  this time. (The  addresses shown in  this dump may
  263.       vary from those shown in your dump.) The output of our  test
  264.       program should look very similar to this data dump.
  265.  
  266.       Now, to make c-window display the first 16 bytes of the file
  267.       we go to line 53 of  "main". Lines 47 - 52 print  either the
  268.       value in "buf" or a  "." if an extended-ASCII character  was
  269.       found.
  270.  
  271.  
  272.    >>g main,53
  273.    0  2f 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a       /***************
  274.    break at main line 53
  275.  
  276.  
  277.       The line of data displayed after the <g> command, but before
  278.       the break message, is the output of the application program.
  279.       The output looks very much like the memory dump that we  saw
  280.       earlier. If this had not been the case then a bug would have
  281.       been present.
  282.  
  283.       Line 53 increments the file position indicator "position" by
  284.       the number of bytes read from the file, "nread". Before line
  285.       53 is  executed it  may be  of some  interest to display the
  286.       value  of  the  "position"  variable  before  the assignment
  287.       statement occurs. The command
  288.  
  289.  
  290.    >>d position
  291.    0
  292.  
  293.  
  294.       shows that the current value of "position" is 0. As  "nread"
  295.       is 16 we expect "position"  to equal 16 after the  execution
  296.       of line 53.
  297.  
  298.       Before  executing  line  53,    I  want to demonstrate another
  299.       powerful feature of c-window called an "automatic  command".
  300.       Since we are interested in the value of "position", it would
  301.       be helpful if its value were displayed whenever we entered a
  302.       command that caused a portion of the program to be executed.
  303.  
  304.       The  automatic  command  feature  is    set  by using the <cs>
  305.       command:
  306.  
  307.  
  308.    >>cs 1 d position
  309.    >>
  310.  
  311.  
  312.       This causes the command "d position" to be executed whenever
  313.       a single step, a breakpoint, or a trace occurs. Now that the
  314.       command has  been entered,  a single    step should  cause the
  315.       contents of "position"  to change, and  the new contents  of
  316.       "position" to be displayed. (Recall that we are currently at
  317.       line 52 in "dump.c")
  318.  
  319.  
  320.    >>s
  321.    step  at main line 38
  322.    <1>d position
  323.    10
  324.  
  325.  
  326.       Notice that when the single step occurred, the message "step
  327.       at main line 38" is displayed, and the automatic command  "d
  328.       position"  is  executed.  The  <1>  means  that  the   first
  329.       automatic command  has been  executed. If  there were  other
  330.       automatic commands  they would  all have  been executed, and
  331.       the number of the automatic command would appear in place of
  332.       the  "1".  A  breakpoint  set  at  line  53 should cause the
  333.       current value of "position"  to be displayed. At  this point
  334.       it should match  what has just  been printed on  the screen.
  335.       The breakpoint can be set with the command:
  336.  
  337.  
  338.    >>cs 2 g
  339.  
  340.  
  341.       This causes  the <g>    command to  be executed  as the second
  342.       automatic command.
  343.  
  344.       Currently  we  have    two  automatic    commands;   the  first
  345.       generates a  breakpoint and  the second  restarts execution.
  346.       Typing the <g> command will cause the program to loop.  This
  347.       loop may be stopped by  pressing the "h" key. Type  <g>, but
  348.       be prepared to type "h."
  349.  
  350.  
  351.    >>g
  352.    10  2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a        ****************
  353.    break at main line 53
  354.    <1>d
  355.    10
  356.    <2>g
  357.    20  2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a        ****************
  358.    break at main line 53
  359.    <1>d position
  360.    20
  361.    <2>g
  362.    30  2a 2f 0d 0a 2f 2a 09 09 09 09 09 09 2a 2f 0d 0a        */../*......*/..
  363.    break at main line 53
  364.    <1>d position
  365.    30
  366.    <2>g
  367.    stopped at main line 38
  368.    >>h
  369.  
  370.  
  371.       If you have not done so  already, press the "h" key on  your
  372.       keyboard.  The  line    at  which  the program stopped may not
  373.       match that shown above, depending upon when the "h" key  was
  374.       pressed. For the remainder  of this demonstration the  point
  375.       where program execution stopped is unimportant.
  376.  
  377.       Notice that c-window echoes  the character "h" after  taking
  378.       control. Also  notice that  the automatic  commands were not
  379.       executed  when  a  keyboard  hit  signaled  to  stop program
  380.       execution. This  was done  so that  if execution  is stopped
  381.       manually it will not be started again, unintentionally,  due
  382.       to an automatic command. (I pressed the "h" key purposely to
  383.       show    the  on-line  help  command.  Press  the  Enter key to
  384.       display the help menu.)
  385.  
  386.       The program-stop feature  you have just  seen can be    useful
  387.       during the early stages of debugging when a program does not
  388.       act properly. It may not  hit any of the set    breakpoints or
  389.       may  even  hang  in  an  endless  loop. Pressing a key, when
  390.       console  I/O    is  not  expected,  returns  control  to   the
  391.       executive level of the debugger. This effectively eliminates
  392.       type-ahead when in the debugging mode.
  393.  
  394.       Next I  want to  demonstrate the  variable display commands.
  395.       The <l> and <e> commands  are used to display the  values of
  396.       all local  and global  (external) variables  in the  current
  397.       function.
  398.  
  399.  
  400.    >>l
  401.  
  402.    Function: main
  403.     8[bp]<66be>  argc:  2
  404.        10[bp]<66c0>  argv:  6764,  *argv:  66e0
  405.        -2[bp]<66b4>  infp:   452,  *infp:  11cb
  406.        -4[bp]<66b2>  outfp:    3,  *outfp:  6420
  407.        -6[bp]<66b0>  nread:  10
  408.           si  i:  10
  409.       -22[bp]<66a0>  buf
  410.       -24[bp]<669e>  position: 30
  411.  
  412.  
  413.    >>e
  414.    External data:
  415.    < 434> stdout:   3,    *stdout: 6420
  416.  
  417.  
  418.       There are some interesting  things to note in  the displays.
  419.       First,  the  <l>  command  generated    variables  with   both
  420.       positive and negative offsets  from the "bp" register.  (The
  421.       bp register is  the base pointer  register in the  8086 from
  422.       which all stack variables are referenced.) Variables    passed
  423.       in parameters have  positive offsets and  variable allocated
  424.       on  the  stack  have    negative  offsets. The number within a
  425.       bracket "<>" indicates  the value of  an address within  the
  426.       data    segment.  This    is  a  handy  tool  for  watching  the
  427.       operation of    recursive procedures  and is  also useful  for
  428.       monitoring the amount of  stack space used when  the program
  429.       executes.
  430.  
  431.       The variable "i" was declared as a register variable and the
  432.       local-variable dump  shows which  register the  variable was
  433.       assigned to as well as its current value.
  434.  
  435.       Note that the  value of "outfp"  in the local-variable  dump
  436.       and "stdout"  in the  external-variable dump  are identical.
  437.       This    is  because  the  value  of  "stdout"  was assigned to
  438.       "outfp" on line 37 of the dump program.
  439.  
  440.       The  last  feature  that  I  want  to  demonstrate  is   the
  441.       expression-breakpoint.  This    is  one  of  the most powerful
  442.       features  of    the  debugger  since  it  essentially allows a
  443.       user-definable breakpoint based upon the values of variables
  444.       as  well   as  the   relationships  between    variables.  An
  445.       arbitrarily complex expression can be entered and evaluated,
  446.       and a  breakpoint occurs  when the  expression evaluates  as
  447.       TRUE.
  448.  
  449.       Let's  set  a  breakpoint  such  that  when  the  value   of
  450.       "position"  exceeds  256  (100  hex.)  the  program  returns
  451.       control to the c-window executive. First, the breakpoints at
  452.       "main", line 53, must be cleared. This can be done by:
  453.  
  454.  
  455.    >>bc .
  456.    All breakpoints cleared
  457.    >>cc .
  458.    All auto commands cleared
  459.  
  460.  
  461.       Next,  the  expression-breakpoint  can  be  set  using   the
  462.       command:
  463.  
  464.  
  465.    >>bx main,1,position > 0x100
  466.  
  467.  
  468.       Using the <g> command to begin execution gives:
  469.  
  470.  
  471.      >>g
  472.      40  2f 2a 09 64 75 6d 70 2e 63 09 09 09 09 09 2a 2f     /*.dump.c.....*/
  473.      50  0d 0a 2f 2a 09 09 09 09 09 09 2a 2f 0d 0a 2f 2a     ../*......*/../*
  474.      60  09 44 75 6d 70 20 74 68 65 20 63 6f 6e 74 65 64     .Dump the conten
  475.      70  74 73 20 6f 66 20 74 68 65 20 73 70 65 63 69 66     ts of the specif
  476.      80  69 65 64 09 2a 2f 0d 0a 2f 2a 09 66 69 6c 65 20     ied.*/../*.file
  477.      90  74 6f 20 74 68 65 20 73 63 72 65 65 2e 09 2a 2f     to the screen or
  478.      a0  20 6f 75 74 70 75 74 20 66 69 6c 65 2e 09 2a 2f      output file..*/
  479.      b0  0d 0a 2f 2a 09 09 09 09 09 09 2a 2f 0d 0a 2f 2a     ../*......*/../*
  480.      c0  2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a     ****************
  481.      d0  2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a     ****************
  482.      e0  2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a     ****************
  483.      f0  0d 0a 0d 0a 23 69 6e 63 6c 75 64 65 20 3c 73 74     ....#include <st
  484.     100  64 69 6f 2e 68 3e 0d 0a 23 64 65 66 69 6e 65 20     dio.h>..#define
  485.      expression break at main line 38
  486.      position > 0x100  :1
  487.      >>
  488.  
  489.  
  490.  
  491.       The  hex.  dump  of  the  program  continued until the first
  492.       statement after  which the  contents of  "position" exceeded
  493.       100. This was at line 38.
  494.  
  495.       Now we let the program execute until it terminates, at which
  496.       time    it  will  return  to  DOS  as  in  a  normal   program
  497.       termination. The <g> command    is used after we  have cleared
  498.       all automatic commands.
  499.  
  500.  
  501.      >>bx .
  502.      >>g
  503.  
  504.  
  505.  
  506.       This is  only the  tip of  the iceberg.  Experiment with the
  507.       "cwdump.exe" module; become familiar with its commands.
  508.  
  509.       We  at  c-systems  hope  that  you  will  find  the c-window
  510.       debugger, used in  conjunction with the  c-systems compiler,
  511.       to be  as useful  in your  software development  projects as
  512.       they have been in ours.
  513.  
  514. Command Summary
  515. ---------------
  516.  
  517.       A brief summary and explanation of the commands supported by
  518.       c-window are provided below.
  519.  
  520.  
  521.          s                    Single step
  522.          t n                Trace n statements
  523.          g                    Execute
  524.  
  525.  
  526.          bs  <fname>,<line>,[count]     Set execution break
  527.          bc  [<fname>,line[.]        Clear break
  528.          b                    Display execution breakpoints
  529.  
  530.  
  531.          bx  <fname>,<count>,<expr>     Set expression break
  532.          bx  .                Clear expression breakpoint
  533.          bx                 Display expression breakpoint
  534.  
  535.  
  536.          cs [#] <expr>            Enter automatic command
  537.          cc [#] [.]             Clear automatic command
  538.          cd [#]                Display automatic command
  539.  
  540.  
  541.          d[d] [x] [c] [s] [b] [w]        Display expression
  542.          dl[x] <lvar>      [w]        Display expression
  543.  
  544.  
  545.          l                    Display local variables
  546.          e                    Display external variables
  547.          p                    Display execution position pointer
  548.          c <line>                Display source code at  <line>
  549.  
  550.          fs,<expr>,<string>         Place <string> at <expr>
  551.  
  552.          ex                 Exit to dos
  553.  
  554.  
  555.       The <s>  command causes  the program    to single  step one  C
  556.       source-level statement  and then  display a  message showing
  557.       the current function name and line number.
  558.  
  559.       The <t> command traces through "n" C source-level statements
  560.       and  displays  a  message  after  each statement showing the
  561.       current function and line number.
  562.  
  563.       The <g> or "go" command causes program execution to begin at
  564.       the current  position in  the program  and continue  until a
  565.       breakpoint is encountered, or until the program  terminates.
  566.       Optionally, a non-sticky breakpoint can be entered with  the
  567.       <g>  command    to  cause  program  execution to stop when the
  568.       function name and line number are encountered. The syntax of
  569.       the non-sticky breakpoint is    <g fname, line> where  "fname"
  570.       is the function name and "line" is the line number.
  571.  
  572.       The  <bs>   or  breakpoint-set   command  causes   a    sticky
  573.       breakpoint to be set    at function name <fname>,  line number
  574.       <line>, with    an optional  count <count>.  The <bs>  command
  575.       causes  program  execution  to  stop    and control returns to
  576.       c-window  whenever  the  function  name  and line number are
  577.       executed <count> times. If the count is omitted, a count  of
  578.       1 is assumed.
  579.  
  580.       The <bc> command clears a sticky breakpoint. The <fname> and
  581.       line number are specified in the same format as used by  the
  582.       <bs> command. All breakpoints may be cleared    simultaneously
  583.       by using the <bc .> command.
  584.  
  585.       The  <b>  command  displays  all  sticky  breakpoints. If no
  586.       sticky  breakpoints  are  currently  set,  a message to that
  587.       effect is displayed.
  588.  
  589.       The <bx> command sets an expression breakpoint <expr> within
  590.       function <fname> at count <count>. An expression  breakpoint
  591.       differs from    a normal  breakpoint in  the way  the break is
  592.       determined. With a normal breakpoint, the break occurs  when
  593.       program  execution  reaches  a  certain  line in a specified
  594.       function.  An  expression  breakpoint,  however, operates by
  595.       evaluating  the  given  expression  <expr>, and a breakpoint
  596.       occurs when <expr> is TRUE <count> times. This is one of the
  597.       most powerful commands in c-window since boundary conditions
  598.       can  be  checked  and  execution  stopped  when  known error
  599.       conditions occur, instead of repeatedly setting  breakpoints
  600.       until the error is  trapped. All expression breakpoints  may
  601.       be cleared by following the <bx> commands by a period.
  602.  
  603.       The  <cs>  command  is  another  very  powerful  command  in
  604.       c-window. The <cs> command is used to establish a maximum of
  605.       5 automatic commands    that are executed  each time a    single
  606.       step, a trace, or a breakpoint occurs. Any command which can
  607.       be entered on  the c-window command  line can be  used as an
  608.       automatic  command.  This  feature  is  very    helpful   when
  609.       specific variables are being interrogated frequently,  since
  610.       the variables are displayed when any action is taken by  the
  611.       program  under  test.  The  <#>  specifies the number of the
  612.       automatic commands. Automatic  commands are always  executed
  613.       starting from the lowest number (usually 1) and ending  with
  614.       the highest number found.
  615.  
  616.       The <cc> command can be used to clear automatic commands. If
  617.       a  number  between  1  and  5  is entered, the corresponding
  618.       automatic  command  is  cleared.  Use  <cc  .>  to clear all
  619.       automatic commands.
  620.  
  621.       The  <cd  #>    command  displays  the    automatic command with
  622.       number  "#"  and  executes  that  command.  This can be used
  623.       almost  as  a  macro    in  the  sense    that  if an expression
  624.       containing many characters is displayed, the expression  can
  625.       be entered once as an automatic command and then executed by
  626.       asking for the display of that automatic command.
  627.  
  628.       The <d> command displays  variables in a number  of formats.
  629.       The  default    display-format    is  hexadecimal.  This    can be
  630.       overridden  by  appending  another  character  to  the   <d>
  631.       command. The available formats are listed below:
  632.  
  633.  
  634.            dd      Display in decimal
  635.            dx      Display in hexadecimal
  636.            dc      Display as an ASCII character
  637.            ds      Display as an ASCII text string
  638.            db      Display as a byte format hexadecimal dump
  639.            dw      Display as a word format hexadecimal dump
  640.  
  641.  
  642.       The <fs> command is used to initialize a character array  or
  643.       the  address    pointed  to  by  a  pointer,  to an ASCII text
  644.       string.  It  is  assumed  that  that    the  string  is   null
  645.       terminated.
  646.  
  647.       The <l> command displays all local variables declared within
  648.       the currently executing function.
  649.  
  650.       The  <e>  command  displays  all external (global) variables
  651.       declared and used in the currently executing function.
  652.  
  653.       The  <p>  command  (position)  displays the current function
  654.       name and line number.
  655.  
  656.       The <ex>  command terminates    execution of  both the program
  657.       under test and c-window. Control is returned to DOS.
  658.