home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / BXD26.ZIP / BXD2.DOC < prev   
Text File  |  1989-05-28  |  15KB  |  374 lines

  1.             b r a n d X  S Y M B O L I C  D E B U G G E R
  2.                            version 2.6
  3.  
  4.                         by Sonam G. Gyato
  5.  
  6. What is bXd:
  7.  
  8.    This software is a full-screen debugger for the IBM series of
  9. personal computers and very close compatibles. The major feature
  10. of bXd is its ability to run without disturbing the display
  11. screen of the program being debugged. It supports both the MDA
  12. and CGA boards (also CGA specific modes of EGA).
  13.  
  14.    Some of the other features are:
  15.       - Support for Symbol Files
  16.         With this feature code will be disassembled using label
  17.         names and addresses can be specified using label names. 
  18.         Two symbol file formats are supported; including the
  19.         format generated by the widely used MicroSoft linker.
  20.  
  21.       - NMI Reset Switch
  22.         This requires a hardware switch and gives a user the
  23.         ability to trap any program at the press of a button
  24.         (even if interrupts are off).
  25.         By default, this trap is disabled because it causes
  26.         problems with some EGA boards.
  27.  
  28.       - Conditional Breakpoints
  29.         Users can set up to 10 breakpoints that can be triggered
  30.         when user-set conditions are satisfied. For example, a
  31.         breakpoint can be enabled only when AX register is
  32.         greater than 10 and when the Zero-bit of the flag
  33.         register is set.
  34.  
  35.       - Online Help
  36.         Detailed descriptions on all the available commands.
  37.         First time users are encouraged to go through them all at
  38.         least once.
  39.  
  40.  
  41. Design Philosophy:
  42.  
  43.    Simple, but can also cut the mustard.
  44.  
  45.    During the design phase of this software, the user and his
  46. goal when running any debugger was kept very much in mind.
  47. Together, the command set, screen design and the user-interface
  48. enable any program to be debugged effectively and transparently.
  49.  
  50.    After a few debugging sessions, you won't have to worry about
  51. how to use bXd and can instead concentrate on your goal -
  52. debugging your code.
  53.  
  54.  
  55. Software for Bacon Deal:
  56.  
  57.    bXd is a "shareware" software. You most probably got it from a
  58. bulletin board or a friend at no cost to you. After using it for
  59. sometime, I'm sure you'll appreciate not only the capability but
  60. also the overall design of this software. You are invited to use
  61. and distribute it to whomever you wish. This is my contribution
  62. to the "shareware" concept.
  63.  
  64.    You must understand that someone, namely yours truly, spent
  65. quite a few hours on this software's development. It seems only
  66. natural that I, like other independent software developers, be
  67. encouraged so that users like you continue to have access to good
  68. software at a reasonable cost. This encouragement and your
  69. contribution to the "shareware" concept takes in the form of the
  70. user sending in a registration fee.
  71.  
  72.    Sending in of this contribution is usually the end of most
  73. "software for bacon" deals - not so this one. If you send the
  74. contribution, you will receive a copy of the non-shareware
  75. version of bXd (bXd3). The '3' at the end of bXd is fully
  76. warranted. There are two major additions and they are -
  77.  
  78.  - Source-Code Debugging
  79.    This option will support all the compilers that generate
  80.    source-information and that can be linked using MS linker.
  81.    This includes MicroSoft C and Turbo C (other languages ok
  82.    also). It will -
  83.      - display in src or src/asm mode
  84.      - auto-sync of code and source information
  85.      - unlimited number of source files
  86.    
  87.  - Dual Monitor Display
  88.    One disadvantage using a full-screen debugger to debug
  89.    graphics program with one monitor, is that the target program
  90.    cannot access the screen directly. With this new dual-monitor
  91.    debugging ability (two monitors with different adapters
  92.    required) there is no such restriction. Your program can
  93.    access the video screen and the adaptor board directly.
  94.              
  95.    I hope that the addition of these two extra features, a
  96. printed manual and a guarantee of a better product will urge you
  97. to keep your part of the "shareware" bargain (pun intended) and
  98. send in the bacon. 
  99.  
  100.    Please send your contribution of $35 to:
  101.                          Sonam G. Gyato
  102.                         240, 76th Street
  103.                       North Bergen,  NJ 07047
  104.  
  105.  
  106. bXd AND YOUR PROGRAM:
  107.  
  108. Below is the format of invoking bXd from the DOS prompt.
  109.  
  110.    A>bXd userprog [user_arguments] [<userCON.txt]
  111.  
  112. 1. The first argument is the name of the file to be debugged
  113.    (target prog). If no extension is given, bXd tries first to
  114.    load a COM and then an EXE file. The status of the loading
  115.    will be displayed.
  116.  
  117.    If a program is loaded, then bXd tries to load the symbol file
  118.    associated it. First a SYM and then a MAP format file. More on
  119.    the formats later.
  120.  
  121. 2. The second set of arguments is what will be passed to your 
  122.    program in a buffer as its command line input. When the main
  123.    bXd screen is displayed initially, this buffer (DS:80) is
  124.    displayed in the data window.
  125.  
  126. 3. bXd does not use DOS for its console i/o. So if the target
  127.    prog expects a constant sequence of chars, it could be
  128.    redirected from a file. You can also redirect the DOS output.
  129.  
  130.  
  131. SCREEN FORMAT:
  132.  
  133. The bXd screen is divided into six different windows.
  134.  
  135.    USER
  136.    This is the window from which all comds are issued. There are
  137.    two ways of doing it
  138.       - Line-Input Command (LIC)
  139.         This is the method used by most debuggers. You type a
  140.         command id followed by optional arguments.
  141.       - Special-Key Command (SKC)
  142.         The second method is through using a single key, like the
  143.         function or the cursor keys. You can invoke these even
  144.         when you're in the middle of a LIC.
  145.  
  146.    CODE
  147.    The program code is unassembled in this window. If a symbol
  148.    file was loaded, defined addressed will be displayed using
  149.    their variable equivalent. You can scroll the info from the
  150.    USER window using the cursor keys.
  151.  
  152.    REGISTER
  153.    The user register values are displayed in this window. You can
  154.    edit the values using the 'R' Line-Input command.
  155.  
  156.    DATA
  157.    Memory is displayed in this section in both hex and ascii
  158.    formats. Using the FK3 and FK4, you can select which of the
  159.    two available windows will be primary.
  160.    You can scroll the info in the primary data window from the
  161.    USER window with the <cntrl-PgUp> and <cntrl-PgDn> keys.
  162.  
  163.    STACK
  164.    The current value pointed to by the stack pointer (SS:SP) is
  165.    displayed at the bottom of the window. The values displayed
  166.    above it are the subsequent memory locations.
  167.  
  168.    CURRENT WINDOW HELP
  169.    You can move the cursor to other windows besides the USER.
  170.    This window displays a brief help text on the window the
  171.    cursor is in.
  172.  
  173.  
  174. COMMANDS
  175.  
  176. Single-Input Commands:
  177.  
  178. FK1     Display the online help menu.
  179.         You can choose a command by pressing the hi-lighted
  180.         letter in each topic header. You can also accomplish the
  181.         same by moving the topic-selector bar with the cursor
  182.         keys and then pressing RETURN when the bar is over the
  183.         topic header.
  184.         Press ESC to quit.
  185.  
  186. FK2     Display the target program's display.
  187.         Once displayed, press any key to return to bXd screen.
  188.  
  189.         TECHNICAL:
  190.         Since there is a limited amount of video memory present
  191.         and both the target and bXd's display has to co-exist,
  192.         there are restrictions to how the target program accesses
  193.         the display.
  194.          MDA There is only one display page in monochrome mode,
  195.              therefore the target program cannot access the video
  196.              RAM directly. It must go through DOS or BIOS level
  197.              routines.
  198.          CGA In CGA equipped pc's, bXd uses the last of the four
  199.              text pages (BB00:0). This means that in text modes,
  200.              target programs can write directly to the screen for
  201.              the first three pages. It will have to go though DOS
  202.              or BIOS level routines for the fourth page.
  203.  
  204.              In graphics modes, CGA needs all of the 16K
  205.              available. Therefore, all plots must go through BIOS
  206.              level routines. Most probably, this will be too
  207.              slow...but you can write directly to screen once the
  208.              program is fully debugged.
  209.  
  210. FK3     Toggle the mode of the data window.
  211.         There are two modes for display
  212.            - single: one window of 6 data lines are displayed.
  213.              The window displayed is primary.
  214.            - dual: two windows of 3 lines each are displayed. The
  215.              primary window is pointed to by an arrow on the line
  216.              between the two windows.
  217.         See FK4
  218.  
  219. FK4     Toggle primary window.
  220.         Primary window is the one to which all data related
  221.         commands are acted on. For example, 'display data' and
  222.         'edit data' comds act on the primary window.
  223.         See FK3.
  224.  
  225. FK5    Toggle the trace condition for the CALL instruction
  226.         (default: ON).
  227.         See FK7.
  228.  
  229. FK6     Toggle the trace condition for the INT and REPx
  230.         instructions (default: OFF).
  231.         See FK7.
  232.  
  233. FK7     Trace one instruction.
  234.         A single instruction at the current pointer (CS:IP) is
  235.         executed. Once executed, if any registers changed it will
  236.         flash on the bXd screen; also if any of the bytes in the
  237.         data window changed it will be displayed in red. Both
  238.         these conditions will be reset when the next command is
  239.         given.
  240.  
  241.         The INT, REPx and the CALL instructions are treated in  
  242.         a special way. The current trace conditions for these
  243.         instructions are displayed at the bottom of the bXd
  244.         screen. The condition for the INT and REPx instructions
  245.         are linked (meaning that one condition controls both
  246.         instructions). If the condition is YES, then the
  247.         instructions will be traced through. If the condition is
  248.         NO, then the  instructions are executed in one shot.
  249.         See FK5, FK6.
  250.  
  251. FK9     Set/Reset Breakpoint.
  252.         In the CODE window there is always one instruction that
  253.         is hi-lighted. You can select which line gets hilighted
  254.         by using the cursor up/down keys. Pressing FK9 toggles a
  255.         brkpt at the currently hilighted instruction. An enabled
  256.         brkpt is marked by an asterisk before the instruction.
  257.  
  258. FK10    Edit breakpoints.
  259.         Once pressed, the brkpt window will be displayed. There
  260.         are 10 breakpoints available. You can select a particular
  261.         brkpt to edit using the cursor keys.
  262.         Press ESC to quit.
  263.  
  264.         There are 5 fields for each brkpt. You can select a
  265.         particular field by pressing TAB (next field) and the
  266.         shift-TAB (previous field) keys.
  267.           ON/OFF  Press the SPACE key to toggle the current
  268.                   state.
  269.           SEGMENT Segment value of the brkpt.
  270.                   Default is the current code segment.
  271.           OFFSET  Offset value.
  272.           HIT     Number of times the above address is executed
  273.                   before the brkpt is signalled.
  274.                   Default is 1.
  275.           CONTROL One or two conditions can also be set before a
  276.                   brkpt is signalled. A condition consists of one
  277.                   of the eight binary operators allowed. The
  278.                   operands can be either register names or hex
  279.                   constants. If both the conditions specified,
  280.                   then BOTH have to be satisfied for the brkpt to
  281.                   be signalled.
  282.                   Default is "no conditions".
  283.  
  284.  
  285. Line-Input Commands:
  286.  
  287.    This is the format most are familiar with. It consists of a
  288. command followed by optional arguments. There are four types of
  289. arguments
  290.  - address...you can specify a segment and offset or just offset.
  291.  - byte...a value less than 256 decimal.
  292.  - string...a set of ascii letters in quotes (ex: "str").
  293.  
  294.    The values that are required for the above fields can also be
  295. specified in different ways. They can be hex constants, register
  296. names or symbolic names (provided a symbol file has been read).
  297. Values can also be formed using the binary operators +,-,* and /
  298. (precedence is left to right).
  299.  
  300.    Below are few examples using the Display command.
  301.  
  302.     - d ds:100
  303.     - d ds:MAIN
  304.     - d es-1:
  305.     - d bp+si
  306.  
  307.    There is extensive online help facility on all the commands.
  308. Refer to it (pressing FK1) to get the details on individual
  309. commands.
  310.  
  311.  
  312. Symbol File Format:
  313.  
  314.    Debugging in hexadecimal is not only dreary but also tends to
  315. waste development time. Searching for particular procedures is
  316. time that you waste and does not bring you any closer to finding
  317. your bugs. This difficulty is greatly alleviated if you can debug
  318. using symbolic variables...and this is exactly what bXd allows
  319. you to do. It gets the variable/address information from files
  320. generated by program linkers and supports two different types.
  321.  
  322.  
  323.      -  The first is a file having the same name as the program
  324.         but with the extension SYM. For example, if the program
  325.         name is PROG.EXE, then the symbol file associated with it
  326.         would be PROG.SYM.
  327.  
  328.         The format of the file is lines consisting of hex
  329.         constants, space and the ascii symbolic name associated
  330.         with it. Below is such an example. Note that underscore
  331.         and dollar characters are valid.
  332.  
  333.              034F nmi_
  334.              03C7 wrt_reg
  335.              04DB continue
  336.              046C wrt$hex
  337.  
  338.      -  The second format is the file that is generated by the MS
  339.         linker and assumes the file extension MAP. This will be
  340.         of use to many users because this linker comes free with
  341.         your DOS disk and is used by many compilers and
  342.         assemblers.
  343.  
  344.         The format if the map file is very important and this
  345.         version has been tested with MASM 4.0. For the debugger
  346.         to differentiate between data and code variables, you
  347.         must put the variables in their proper class (code or
  348.         data). The name of the segment is not important, but the
  349.         class is. If the class is 'code','rom' or 'static' it is
  350.         considered to be a code segment, else data.
  351.         Classes are set when you define a segment. For example to
  352.         define a code segment you would write.
  353.  
  354.              codeseg   segment 'code'
  355.  
  356. bXd will try to load a file of the SYM format file first. If that
  357. is not found then it tries the MAP format file. Symbols are
  358. stored dynamically...therefore you can store in excess of a
  359. thousand variables.
  360.  
  361.  
  362. End Note to all Users:
  363.  
  364.    I hope that this document and more importantly the bXd program
  365. will be of help to you and other PC users. This version has been
  366. tested thoroughly (a major portion of bXd was debugged with bXd)
  367. and right now I feel that it is bugfree. But if someone does find
  368. one or has suggestions for improvements, let me know.
  369.  
  370.    Thank you for taking an interest in this product and until the
  371. next release of bXd3...keep spreading the good word about bXd.
  372.  
  373. [SGG 08/21/87]
  374.