home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s150 / 1.ddi / TD.ZIP / HELPME!.DOC next >
Encoding:
Text File  |  1990-05-07  |  19.8 KB  |  464 lines

  1. /***********************************************************************/
  2.               TURBO DEBUGGER 2.0 COMMON QUESTIONS AND ANSWERS
  3.               -----------------------------------------------
  4.  
  5.   Below is a list of the most commonly asked questions about Turbo Debugger.
  6.   Following this list is an explanation of some of the new mouse features
  7.   in Turbo Debugger 2.0.
  8.  
  9.   1. How does TD handle screen output for graphics- and text-based
  10.      programs?
  11.  
  12.      Turbo Debugger has a number of strategies that it can use to
  13.      control how and when the screen gets refreshed. If you are
  14.      debugging a program that uses a graphics display mode, if
  15.      you want to use Borland pop-up utilities such as SideKick
  16.      and SideKick Plus while inside Turbo Debugger, or if you want to
  17.      run programs from Turbo Debugger's DOS Shell that write 
  18.      directly to video memory, you should review the following tips.
  19.  
  20.      The default screen-updating mode is "Flip"; this means that
  21.      Turbo Debugger uses an alternate video display page on
  22.      adapters that support multiple display pages. This results
  23.      in fast screen-swapping between Turbo Debugger and your
  24.      program, but it also can interfere with the operation of
  25.      pop-up utilities and graphics programs.
  26.  
  27.      Pop-up utilities may not appear on the screen, even though 
  28.      they are active and processing your keystrokes. You must
  29.      select "Swap" mode for display updating in order for these 
  30.      programs to work properly. Use Turbo Debugger's -ds command-line
  31.      option to do this, or use the TDINST utility to permanently
  32.      set this mode. "Swap" mode makes screen updating slower, but
  33.      it makes sure that Turbo Debugger's screen does not interfere 
  34.      with either your program's or any other program's display.
  35.  
  36.      You may also need to use "Swap" when you use the DOS Shell
  37.      command or run an editor from within TD. Most programs
  38.      expect to run on video page 0, and do not check to see what
  39.      the current video page is. TD's DOS Shell and any editors
  40.      that TD runs in "Flip" mode do not run from video page 0,
  41.      and the programs may appear to hang, even though you will be
  42.      able to type in keystrokes normally. If this happens, use
  43.      the -ds command-line option when you run TD or reinstall TD
  44.      to use "Swap" instead of "Flip."
  45.  
  46.      If you are debugging a graphics mode application, you must
  47.      specify the -ds command-line option ("Swap" contents) and
  48.      you may want to use Turbo Debugger's -vg command-line
  49.      option (Graphics Save). This causes additional memory to be
  50.      set aside for saving the entire graphics image your
  51.      program produces. If you don't use this option, a "red
  52.      cloud" may appear on your program's screen. These options
  53.      can also be set permanently by using the TDINST program.
  54.      The Graphics Save option takes an additional 8K of memory
  55.      and slows screen-swapping.
  56.  
  57.      If you are running a graphics program that changes the EGA
  58.      palette, make sure you use the -vp command-line option to
  59.      save the palette.
  60.  
  61.   2. Can Turbo Debugger execute other programs while you are
  62.      still using the debugger?
  63.  
  64.      The DOS Shell and Edit commands in the Module and File
  65.      windows can swap the program you are debugging to disk in
  66.      order to make room to run DOS or your editor. The default
  67.      amount of memory to swap is 128K. You can use TDINST to set a
  68.      different amount if that's not enough memory to run your
  69.      editor or other programs. Setting the swap size to 0K tells
  70.      Turbo Debugger to swap the entire user program to disk
  71.      before running the DOS command processor.
  72.  
  73.      Only your program gets swapped to disk; Turbo Debugger
  74.      remains in memory.
  75.  
  76.   3. How can I break out of a program even though interrupts are
  77.      disabled?
  78.  
  79.      If you have an 80386-chip-based computer and are using
  80.      TD386, option -B allows break even when interrupts are
  81.      disabled. For example, this option enables a break from
  82.  
  83.        CLI
  84.        JMP $
  85.  
  86.   4. Why can't I press Ctrl-Break to get out of a program
  87.      running on a remote machine?
  88.  
  89.      The program running in the remote machine has taken control
  90.      of Interrupt 1B (Ctrl-Break). TDREMOTE does not take back
  91.      control of Interrupt 1B until you stop execution of the
  92.      running program on the debugger side by completing the
  93.      program or pressing Ctrl-F2 (Program Reset).
  94.  
  95.  
  96.   5. What are some of the syntactic and parsing differences
  97.      between Turbo Debugger's built-in assembler and the
  98.      standalone Turbo Assembler?
  99.  
  100.      A discussion follows this short example program:
  101.  
  102.               .model small
  103.               .data
  104.  
  105.        abc    struc
  106.        mem1   dd      ?
  107.        mem2   db      ?
  108.        mem3   db      "   "
  109.        abc    ends
  110.  
  111.               align   16
  112.        a      abc     <1,2,"xyz">
  113.  
  114.        msg1   db      "testing 1 2 3", 0
  115.        msg2   db      "hello world", 0
  116.        nmptr  dw      msg1
  117.        fmptr  dd      msg1,msg2
  118.        nfmptr dw      fmptr
  119.        xx     dw      seg a
  120.  
  121.               .code
  122.  
  123.               push   cs
  124.               pop    ds
  125.               mov    bx,offset a
  126.               mov    bx,nmptr
  127.               les    si,fmptr
  128.               mov    ah,4ch
  129.               int    21h
  130.               end
  131.  
  132.      The assembler expression parser does not accept all legal
  133.      TASM instruction operands. This allows TD's assembler
  134.      expressions to be more general and allows multiple levels of
  135.      memory-referencing, more like that used in C and Pascal.
  136.      However, there are a few constructs that you may be used to
  137.      that you'll have to specify differently for the TD assembler
  138.      expression parser to accept them:
  139.  
  140.        a. Size overrides should always appear inside the
  141.           brackets; PTR is optional after the size. Also, when
  142.           referring to a structure, you must use the name of the
  143.           struc, not the name of the variable:
  144.  
  145.             OK:  [byte ptr bx]   [dword si]        [abc bx]
  146.  
  147.             BAD: byte ptr[bx]    [struc abc bx]    [a bx]
  148.  
  149.        b. You must specify a structure name when accessing the
  150.           members of a structure via a register pointer:
  151.  
  152.             OK:  [abc ptr bx].mem1  [abc bx].mem3 + 1
  153.  
  154.             BAD: [bx].mem1
  155.  
  156.        c. You can't use multiple instances of [] unless they are
  157.           adjacent, and you can only follow an [] expression with
  158.           a dot and a structure member name or another []
  159.           expression:
  160.  
  161.             OK:  4[bx][si]    [abc bx].mem2
  162.  
  163.             BAD: [bx]4[si]    [bx]+4
  164.  
  165.        d. If you use a register as part of a memory expression
  166.           and you don't specify a size, WORD is assumed:
  167.  
  168.             [bx] is the same as [word bx]
  169.  
  170.        e. You can use any register you want between [], not just
  171.           the combinations of BX, BP, SI, and DI allowed in
  172.           instruction operands:
  173.  
  174.             OK:  [ax+bx]   [bx+sp]
  175.  
  176.        f. You can use multiple levels of [] to follow chains of
  177.           pointers:
  178.  
  179.             OK:  [byte [[nfmptr]+4]]
  180.  
  181.        g. Be careful using registers to access memory locations.
  182.           You may get unexpected results if your segment
  183.           registers are not set up properly. If you don't
  184.           explicitly specify a segment register, Turbo Debugger
  185.           uses the DS register to reference memory.
  186.  
  187.        h. When you do specify a segment register, make sure you
  188.           follow the same rule for size overrides: put it
  189.           INSIDE the brackets:
  190.  
  191.             OK:  [byte es:di]    [es:fmptr]
  192.  
  193.             BAD: es:[byte di]
  194.  
  195.        i. Use the OFFSET operator to get the address of a
  196.           variable or structure. Turbo Debugger automatically
  197.           supplies the [] around a variable name if you just type
  198.           the variable name alone:
  199.  
  200.             a            contents of structure a
  201.             [a]          contents of structure a
  202.             offset a     address of structure a
  203.  
  204.        j. You can use the type overrides and the format control
  205.           count to examine any area of memory displayed as you
  206.           wish:
  207.  
  208.             [byte es:bx],10  10 bytes pointed to by es:bx
  209.             [dword ds:si],4  4 dwords pointed to by ds:si
  210.  
  211.           This is very useful when specifying watch expressions.
  212.  
  213.        k. Sometimes you use a word memory location or register to
  214.           point to a paragraph in memory that contains a data
  215.           structure. Access the structure with expressions like
  216.  
  217.             [abc [xx]:0].mem1
  218.             [abc es:0].mem3
  219.  
  220.   6. Are there any syntactic or parsing differences between Turbo
  221.      Debugger's C expression evaluation and Turbo C++'s?
  222.  
  223.      You can't pass constant-string arguments when evaluating
  224.      functions.
  225.  
  226.        OK:   myfunc(123)   myfunc(string_variable)
  227.  
  228.        BAD:  myfunc("constant")
  229.  
  230.   7. Are there any syntactic or parsing differences between Turbo
  231.      Debugger's Pascal expression evaluation and Turbo Pascal's?
  232.  
  233.      a. Turbo Debugger does not support expressions for set
  234.         constructors:
  235.  
  236.           OK:   [4..7]
  237.  
  238.           BAD:  [myvar1..myvar2]   [3+4..7+8]
  239.  
  240.      b. You can't pass constant-string arguments when evaluating
  241.         functions or procedures.
  242.  
  243.           OK:   MyFunc(123)   MyFunc(StringVariable)
  244.  
  245.           BAD:  MyFunc('Constant')
  246.  
  247.                 MyFunc(StringConstant), where StringConstant is
  248.                 defined with a "const" declaration and is not a
  249.                 typed constant.
  250.  
  251.      c. You can't evaluate procedures or functions that have
  252.         structure VALUE parameters. You can evaluate procedures or
  253.         functions that have structure VARIABLE parameters, though.
  254.  
  255.   8. What should I be aware of when I am debugging multilanguage
  256.      programs with Turbo Debugger?
  257.  
  258.      Turbo Debugger's default source language is "Source," which
  259.      means it chooses the expression language based on the current
  260.      source module. This can cause some confusion if your program
  261.      has source modules written in different languages (like C
  262.      and assembler). Since you are actually entering a language
  263.      expression any time Turbo Debugger prompts you for a value
  264.      or an address, this can cause some unexpected results:
  265.  
  266.      a. Even if you are in a CPU window or a Dump window, you
  267.         must still enter addresses in the source language,
  268.         despite the fact that the window is displaying in hex.
  269.         For example, to display the contents of memory address
  270.         1234:5678, you must type one of the following
  271.         expressions, depending on your current source language:
  272.  
  273.           C            0x1234:0x5678
  274.           Pascal        $1234:$5678
  275.           Assembler      1234:5678
  276.  
  277.      b. When your current language is assembler, you must be
  278.         careful when entering hex numbers, since they are
  279.         interpreted EXACTLY as they would be in an assembler
  280.         source file. This means that if you want to enter a
  281.         number that starts with one of the hex digits A - F, you
  282.         must first precede the letter with a 0 so Turbo Debugger
  283.         knows you are entering a number. Likewise, if your
  284.         number ends in B or D (indicating a binary or decimal
  285.         number), you must add an H to indicate that you really want
  286.         a hex number:
  287.  
  288.           OK:   0aaaa   123dh   89abh
  289.  
  290.           BAD:  aaaa    123d    89ab
  291.  
  292.   9. Why does the text "Cannot be changed" come up when I do an
  293.      assignment in the Data/Evaluate/Modify "New value" pane?
  294.  
  295.      If you use the Data/Evaluate/Modify command (Ctrl-F4) to
  296.      change a variable by direct assignment, the "New value" pane
  297.      will say "Cannot be changed." This doesn't mean the
  298.      assignment didn't take effect. What it does mean is that the
  299.      assignment expression as a whole is not a memory-referencing
  300.      expression whose value you can change by moving to the
  301.      bottom pane. Here are some examples of direct assignment
  302.      expressions:
  303.  
  304.        C              x = 4
  305.        Pascal         ratio := 1.234
  306.        Assembler      wval = 4 shl 2
  307.  
  308.      If you had typed just "x," "ratio," or "wval" into the top
  309.      pane, then you would be able to move to the bottom pane and
  310.      enter a new value. The direct assignment method using the
  311.      "=" or ":=" assignment operator is quicker and more
  312.      convenient if you don't care about examining the value of
  313.      the variable before modifying it.
  314.  
  315.  10. Why does an inspector occasionally display question marks
  316.      when inspecting a Turbo C++ register variable?
  317.  
  318.      If you inspect a register variable that is not in the
  319.      current scope, you'll see ???? for the value. A register
  320.      variable only displays a value if the register is in your
  321.      current scope (valid at the current location in your
  322.      program).
  323.  
  324.  11. What is the most likely reason for Turbo Debugger to hang
  325.      when starting up on a PC-compatible computer?
  326.  
  327.      If your computer is a Tandy 1000A, IBM PC Convertible, or
  328.      NEC MultiSpeed, or if TD hangs when loading on your system,
  329.      run TDINST and change the item in the Options\Miscellaneous
  330.      menu so that NMI Intercept is not set. Some computers use
  331.      the NMI (Non-Maskable Interrupt) in ways that conflict with TD,
  332.      so you must disable TD's use of this interrupt in order to
  333.      run the program.
  334.  
  335.      Also, if you are using a 80386-based machine and have the
  336.      SuperKey utility loaded, be careful not to press a key when
  337.      TD386 is loading, since SuperKey may capture the keystroke
  338.      and cause unexpected results.
  339.  
  340.  12. What could happen when global breakpoints are set on local
  341.      variables?
  342.  
  343.      When you set global breakpoints using local variables, make
  344.      sure the breakpoints are cleared before you exit the
  345.      procedure or function that the variables are defined in. The
  346.      best way to do this is to put a breakpoint on the last line
  347.      of the procedure or function. If you do not clear the
  348.      breakpoints, your program will break unexpectedly and may
  349.      even hang on some machines because the breakpoints are being
  350.      set in memory that is not currently being used by the
  351.      procedure or function.
  352.  
  353.  13. How can I save options set in TDINST to TD286.EXE?
  354.  
  355.      If you have a configuration file (tdconfig.td) already made for
  356.      TD.EXE, TD286.EXE will automatically use this configuration file.
  357.      You can save a configuration made in TDINST to TD286.EXE directly
  358.      if you state this on the command line. For instance,
  359.  
  360.        TDINST TD286.EXE
  361.  
  362.      When you want to save this configuration in TDINST, just select
  363.      Save\Modify td.exe.
  364.  
  365.  14. Why is execution is slower when tracing (F7) than when stepping
  366.      (F8) through my programs?
  367.  
  368.      Turbo Debugger now has the capability for reverse execution. This
  369.      means that when you are tracing through your program TD is saving
  370.      all the information about the source line you just traced over. If
  371.      you want faster execution you can (F8) step over the instruction or
  372.      toggle the Full History option to 'No' in the Execution History
  373.      window.
  374.  
  375.  
  376. *    Common questions about using mouse support in Turbo Debugger 2.0.
  377.  
  378. Turbo Debugger 2.0 now provides mouse support that allows you to manipulate
  379. elements within the user interface. The following lists mouse-related
  380. terms to help you become accustomed to using Turbo Debugger's mouse support.
  381.  
  382. If you have a mouse driver installed by default, Turbo Debugger and TDINST
  383. will try to use your mouse. If you do not wish to use your mouse during a
  384. debugging session, you can use the command-line switch '-p-' to turn the
  385. mouse off. This can also be set in TDINST in the Options\Input & prompting
  386. dialog box.
  387.  
  388. Clicking and Dragging
  389.     Most mice provide two or three buttons that allow for various
  390.     functions inside an application. In Turbo Debugger you can,
  391.     among other things, use the left mouse button to select options,
  392.     move items around on the screen, and set breakpoints. The right
  393.     mouse button has some of the same functionality as the left mouse
  394.     button, but you can also open local menus within windows using
  395.     this button. Double clicking the mouse on options in a list will
  396.     select that item. For instance, in the File|Open dialog box you
  397.     can highlight a file by clicking the mouse once on the file
  398.     name. You can load the file by double clicking on the name.
  399.     The commands shown at the bottom of the screen, like F1-Help,
  400.     can also be selected using the mouse. Dragging the mouse consists
  401.     of depressing the mouse button and moving the mouse cursor to a
  402.     new location.
  403.  
  404. Mouse drivers
  405.     Your mouse driver is the application that you install to make your
  406.     mouse active inside Turbo Debugger and other programs. Most mouse
  407.     drivers will work with Turbo Debugger but may have to be updated
  408.     to a newer version if you are having problems using an older version.
  409.     If you have problems with the mouse once you have loaded TD or
  410.     TDINST, you might try using the Display Swap option that can be
  411.     specified either in TDINST or on the command-line with the -ds
  412.     switch. Consult your mouse manual to ensure proper use of the
  413.     mouse and its driver. Early versions of mouse drivers don't support
  414.     screen display modes larger than 80 columns by 24 lines. As a result,
  415.     your mouse driver might not work correctly when you use Turbo Debugger's
  416.     enhanced display modes EGA 80x43, VGA 80x50, or EGA/VGA graphics modes.
  417.  
  418. Scroll bars
  419.     Scroll bars, located at the right and bottom of all windows, allow you
  420.     to specify a new position within a window by clicking the mouse on an
  421.     indicator on the scroll bar and dragging it to a new location. Arrows
  422.     located at either end of a scroll bar also allow you to scroll through
  423.     the window when you click and hold the mouse on the arrow heads.
  424.  
  425. Icons
  426.     An icon is a window that has been shrunk down to a smaller
  427.     representation of the window. These icons can be moved with the
  428.     mouse by clicking on the border of the icon and dragging it to a
  429.     new location. Arrows located at the top right of each viewer allow
  430.     you to zoom and unzoom the viewer when you click the mouse on the
  431.     arrows. When you iconize a window, it is stored at the bottom right
  432.     side of the screen. If any other windows are currently showing at
  433.     this position the icon will be put behind that window. The global
  434.     Window menu allows you to pick from a list of currently open windows.
  435.     This will also take you to an iconized window.
  436.  
  437. Resize box
  438.     The resize box is located at the bottom right of each window. You can
  439.     click the mouse on the box and drag the mouse to resize the viewer.
  440.     Using the mouse you can also resize the viewer by clicking the mouse
  441.     on the right border of any window and dragging it. Windows and
  442.     inspectors can be moved using the mouse by clicking on the top and
  443.     left borders and dragging the window to a new location. Double clicking
  444.     the mouse on the top border is a short cut to zoom/unzoom the current
  445.     window.
  446.  
  447. Dialog boxes
  448.     Dialog boxes allow you to select options, specify files to save or
  449.     restore, and choose different settings. You can click the mouse to
  450.     make prompts or panes within the dialog box active. Help for the
  451.     current dialog box is available in by clicking on the Help button
  452.     in the box.
  453.  
  454. Close buttons
  455.      A Close button is located at the top left of all windows and dialog
  456.      boxes. It lets you close the current window or dialog box when you
  457.      click the mouse on it. If you have entered any information into a
  458.      dialog box and you use the Close button to close it, the settings
  459.      you specified in the dialog box will not be saved. This is the same
  460.      as clicking the mouse on the Cancel button inside a dialog box. You
  461.      must select the OK button in dialog boxes in order to save these
  462.      settings.
  463.  
  464.