home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / ASMUTL / PC370.ZIP / DEBUG.DOC < prev    next >
Encoding:
Text File  |  1987-04-21  |  9.9 KB  |  201 lines

  1.  TITLE 'PC/370 Interqctive Debug Facility Documentation'
  2.  
  3.  A.  Overview
  4.  B.  Program Interface
  5.  C.  User Interface
  6.  D.  User Guide
  7.  
  8.  EJECT
  9.  
  10.  A.  Overview
  11.  
  12.      The PC/370 interactive debug facility is designed to provide a
  13.      tool to help debug program errors in either 80x86 code or 370 code.
  14.      The facility provides the basic tools namely tracing program flow
  15.      via breakpoints defined by calls, and displaying register and memory
  16.      contents upon request.  In addition, the facility provides a data
  17.      and address stop option which is very useful for locating errors.
  18.  
  19.  EJECT
  20.  
  21.  B.  Program Interface
  22.  
  23.      The PC/370 interactive debug facility is implemented via a single
  24.      module named MMDBUG which is linked into A370, L370 and E370 programs
  25.      and is called with a single 3 byte ASCII argument located immediately after
  26.      the near call instruction.   In the E370 emulator environment, the
  27.      interactive debugger can be called directly from 370 programs through
  28.      SVC 9 which must be followed by 3 byte EBCDIC argument and a 1 byte
  29.      filler to keep instructions on half word boundary.
  30.  
  31.      There are several special calling arguments as follows:
  32.  
  33.      1.   'OFF' - turn off (kill) trace facility for speed
  34.                   (a trace is killed by replacing call with jump over arg)
  35.      2.   'ON ' - turn trace facility back on (stop killing traces)
  36.      3.   'BUG' - force interactive debug mode
  37.      4.   'IOF' - interrupts off (unsolicited keys queued for input)
  38.      5.   'ION' - interrupts on  (any key stroke invokes user interface)
  39.      6.   'IFL' - instruction fetch loop (special trace used in E370 to
  40.                   identify next trace id as 370 operation trace to be
  41.                   stored in trace table)
  42.  
  43.      The first call to MMDBUG in A370, L370, and E370 is with 'OFF'
  44.      unless the trace option was requested (see PC370.DOC).
  45.  
  46.  EJECT
  47.  
  48.  C.  User Interface
  49.  
  50.      When MMDBUG is called without the 'OFF' argument, or when a key
  51.      is hit without the 'IOF' argument being issued previously, the
  52.      user interface mode is invoked and the following commands may
  53.      be entered in upper or lower case from the console:
  54.  
  55.           A - ADDRESS STOP (PROMPTS FOR ADDRESS, LENGTH, TYPE)
  56.           C - CONTINUE TO NEXT TRACE ENTRY
  57.           D - DUMP MEMORY (PROMPTS FOR ADDRESS)
  58.           F - FIND TRACE ENTRY (PROMPTS FOR TRACE ID)
  59.           H - HELP LIST MMDBUG COMMANDS (THIS LIST)
  60.           I - INSTRUCTION COUNTER WORD
  61.           J - RESET NEXT 370 OR 8086 INSTRUCTION ADDRESS
  62.           K - KILL MODE SET/RESET (CHANGES TRACE CALL TO NOP)
  63.           L - SET/RESET TRACE LIMIT FOR Q/T MODE
  64.           M - MODIFY MEMORY (PROMPTS FOR ADDRESS AND DATA)
  65.           N - LIST LAST 20 TRACE ENTRIES (NOTE K,Z  AFFECT THIS LIST)
  66.           P - SET/RESET PRINT COPY OF ALL MMDBUG I/O
  67.           Q - SET QUIET MODE (USED WITH F, L, AND 'BUG' OPTIONS)
  68.           R - DISPLAY REGISTERS (SEE Z OPTION)
  69.           S - SAVE/UNSAVE CURRENT TRACE ID FROM KILL MODE
  70.           T - SET TRACE MODE (USED WITH OPTIONS F AND L)
  71.           W - LIST FREE MEMORY QUEUE
  72.           X - SET/RESET ASSIST LOGGING OF INTERACTIVE DEBUG OUTPUT
  73.           Y - MODIFY 8086/370 REGISTER (PROMPTS FOR REGISTER/DATA)
  74.           Z - SET/RESET 8086/370 MODE
  75.                 IN 8086 MODE, R DUMPS 8086 REGISTERS AND D PRINTS
  76.                 PRINTABLE ASCII CHARACTERS IN DUMP.
  77.                 IN PC/370 MODE, R DUMPS 370 REGISTERS AND PSW
  78.                 AND D DUMPS PRINTABLE EBCDIC CHARACTERS IN DUMP.
  79.          <cr> - dump same address again as defined in D command
  80.          <sp> - dump forward until any key hit
  81.          <bs> - dump backwards until any key hit
  82.          <esc>- exit to MSDOS after attempting to close files
  83.  
  84.      Memory addresses may be entered in xxxx:xxxx or xxxxxx hex format
  85.      without leading zeros required.  In 370 mode, the xxxxxx format always
  86.      refers to the relative address within the current address space.  In
  87.      80x86 mode, the xxxxxx format refers to the offset using the current
  88.      segment.  The segment:offset is initialized to the CIX extended register
  89.      which uses the data segment and points to the general purpose register
  90.      area in E370 and the common vector table in A370 and L370.
  91.  
  92.  EJECT
  93.  
  94.   D.  User Guide
  95.  
  96. The PC/370 interactive debug facility can assist you in locating
  97. errors within your 370 assembler programs.  But first there are
  98. some more basic things to check:
  99.  
  100.   1.  Are you sure that you are executing the latest version of
  101.       the source program.  To be absolutely sure, code the date
  102.       and time in a print statement at the beginning of the program
  103.       and then reassemble (A370) and relink (L370) and execute the
  104.       program again.
  105.  
  106.   2.  Does the program run to normal termination?  If so then you
  107.       can run the program again specifying a T as the only parameter
  108.       on the execute command to initiate the interactive debug
  109.       facility.  Another way to invoke the interactive debug option
  110.       is to specify option D in the linkage editor.   This method should
  111.       be used if the program requires a parameter other than T.
  112.  
  113.   3.  If the program terminated abnormally, the interactive debug
  114.       facility is automatically initiated along with a display of
  115.       the PSW and the failing instruction.  To calculate the
  116.       relative address of the failing instruction in the program,
  117.       subtract the program load address of X'0200' (Note you will
  118.       have to look at the link edit listing to get the starting
  119.       address if the failing instruction is in a subroutine.
  120.  
  121.   4.  To trace execution of the program, enter T.  To stop the
  122.       trace at any point hit any key.
  123.  
  124.   5.  To continue execution of the program normally, enter Q.
  125.  
  126.   6.  To dump the current contents of the registers, enter R.
  127.  
  128.   7.  To dump any 32 byte area in memory, enter A followed by
  129.       the starting address in hex xxxx.
  130.  
  131.   8.  To continue to dump memory from the current location forward,
  132.       hit the space key.  To dump backwards, hit the backspace key.
  133.       To stop the dump, hit any key.
  134.  
  135.   9.  To stop the program at a specific address, enter A followed
  136.       by the address in hex xxxx followed by the option code A.
  137.       Then use Q or T to continue execution until the address is found.
  138.  
  139.  10.  To stop the program when a specific data field in memory is
  140.       changed, enter A followed by the address in xxxx followed by
  141.       the option code E for equal data or N for not-equal data.
  142.       Next entry the legnth of the data compare in hex when prompted.
  143.       If option E is selected, enter the hex value of the data you
  144.       want to search for when prompted.  Next press Q or T to contine
  145.       execution until the data compare specified triggers debug user
  146.       interface again.  To stop at a specifc instruction count in a
  147.       370 program, use the I command to display the instruction counter
  148.       word and then use data equal address stop on the word.
  149.  
  150.  11.  To turn off any address stop option, enter A.
  151.  
  152.  12.  To list the last 20 instruction trace table entries, enter N.
  153.       If running in 370 mode (option Z toggles mode), only the 370
  154.       instruction traces will be stored and listed via option N.
  155.       In 80x86 mode, all traces will be stored and listed.
  156.       Note that this list may be incomplete if the program
  157.       was started without debug active since option K is the default.
  158.       Option K kills each trace entry to debug the first time debug
  159.       is entered for that trace point.  Option K makes the program
  160.       run much faster at the expense of losing repeated trace points.
  161.       However, with release 1.2 you can use Find to locate selected
  162.       trace id's and use Save to protect id from kill mode.  This
  163.       option allows much faster execution while still being able to
  164.       trace selected id's.  A very useful id to save is IFL which will
  165.       then trace each 370 instruction during kill mode while killing
  166.       all of the lower level ids for reasonable speed yet full
  167.       visibility of 370 instructions.  Faster still is to save only
  168.       one 370 instruction id such as TRT.  This is very useful in
  169.       conjunction with address stop, since the address stop overhead
  170.       is only incurred for the selected saved id's.
  171.  
  172.  13.  To set a fixed limit on the number of trace entries before
  173.       entering debug command mode again, enter L and count in hex xxxx.
  174.       Next enter Q or T to continue until count reached zero.  If
  175.       zero count is entered, the limit is not checked.
  176.  
  177.  14.  To modify memory, enter M followed by address in hex xxxx.
  178.       Next enter hex data bytes followed by return key.
  179.  
  180.  15.  To display the 8086 registers, type Z to switch to 8086 mode.
  181.       Now type R.  In 8086 mode, storage dumps translate data to ASCII
  182.       instead of EBCDIC for character display.  In 8086 mode, N lists all
  183.       trace entries instead of just IFL 370 instruction traces.  In 8086
  184.       mode, Y changes 8086 registers instead of 370 registers.  To return
  185.       to 370 mode, type Z again.
  186.  
  187.  16.  The W command displays free memory in the 8086 data segment for
  188.       80886 mode and the free memory in the current address space in 370
  189.       mode.  Note these are two totally separate free areas.  The 8086
  190.       free area is limited to <= 64k addressable by the DS regiser and
  191.       uses 4 byte free queue elements (next,length).  The 370 free area
  192.       extends from the end of 370 code to <= beginning of the E370 64k
  193.       segment in high memory and uses 8 byte 370 format free queue elements
  194.       (next,length) on 8 byte boundaries.  The first free queue element in
  195.       a 370 address space is pointed to by ASCASF field in address space
  196.       control block located at X'104' in low memory (may be zero if no free
  197.       memory currently available).
  198.  
  199. Please send any suggestions for improving this documentation.
  200.  
  201.