		TURBO DEBUGGER FOR WINDOWS TIPS AND HINTS
			

CONTENTS:
1.  Turbo Debugger for Windows (TDW) Windows debugging hints
2.  TDW mouse support
3.  Answers to common questions


1. Turbo Debugger for Windows (TDW), Windows debugging hints
------------------------------------------------------------
  View|Windows Messages

      If you set up View|Windows Messages to display messages for
      more than one procedure or handle or both, do not log all
      messages.  Instead, log specific messages for each procedure or
      handle.  If you log all messages, the system might hang, in
      which case you will have to reboot to continue.  This behavior
      is due to the large number of messages being transferred
      between Windows and TDW.

      When setting a break on the Mouse class of messages, note that
      a "mouse down" message must be followed by a "mouse up" message
      before the keyboard will become active again.  When you return
      to the application, you might have to press the mouse button
      several times to get Windows to receive a "mouse up" message.
      You'll know Windows has received the message when you see it in the
      bottom pane of the Windows Message window after the program breaks.

      If you enter a handle name but indicate that it's a
      procedure, TDW will accept your input and will not complain. 
      However, when you run your program, TDW will not log any
      messages.  If TDW is not logging messages when you think you've
      set a handle, check the Add Window dialog box of the top left pane of
      the Windows Messages window to see if you've pressed the Handle button.

  View|Module

      The Debug Startup radio buttons are used for DLLs only.  To
      debug EXE startup, begin TDW with the Assembler-mode Startup
      command-line option (-l).

      When a program loaded into TDW is reset, the Load symbols
      radio buttons default to YES for all DLLs and applications
      with symbols, even if you specified NO for a given DLL or
      application prior to resetting the program.

	   
2. TDW mouse support
--------------------
  TDW provides mouse support that allows you to manipulate 
  elements of the user interface. Most TDW mouse operations are 
  similar to Windows mouse operations. In the material that follows,
  we discuss tips for using a mouse under Windows and some uses of 
  the mouse under TDW that are different from Windows mouse usage.

  o When the mouse driver is disabled for Windows, it will be disabled
    for TDW as well.  Starting TDW with the mouse support option
    (-p) has no effect unless you enable the Windows mouse driver.

  o If you have a mouse driver installed by default, TDW and the
    installation utilities will try to use your mouse. If you 
    don't want to use your mouse during a debugging session, you 
    can use the command-line switch '-p-' to turn the mouse off. 
    You can also set this option in TDWINST in the Options\Input & 
    Prompting dialog box.

  o When you're debugging a Windows application that uses the mouse
    and you reset the application and then run the program, it won't
    accept mouse clicks until you make a keyboard entry.

  o Using the mouse

    -  Most mice provide two or three buttons that allow for various
       functions inside an application. With TDW you can, among other 
       things, use the left mouse button to select options, move items 
       around on the screen, and set breakpoints. 

    -  Double-clicking the mouse on an item in a list chooses the item. 
       For instance, in the File|Open dialog box clicking the mouse once 
       just highlights a file. Double-clicking loads the file.

    -  The right mouse button has some of the same functionality as the 
       left mouse button, but you can also open local menus within TDW 
       windows by using this button. 

  o You can also choose the commands shown at the bottom of the screen, 
    like F1-Help, by using the mouse.


Answers to common questions
---------------------------
  Following is a list of the most commonly asked questions about TDW:

  1.  Are there any syntactic or parsing differences between Turbo
      Debugger's Pascal expression evaluation and Turbo Pascal's?

      a. Turbo Debugger does not support expressions for set
         constructors:

          OK:   [4..7]

          BAD:  [myvar1..myvar2]   [3+4..7+8]

      b. You can't pass constant-string arguments when evaluating
         functions or procedures.

          OK:   MyFunc(123)   MyFunc(StringVariable)

          BAD:  MyFunc('Constant')

                MyFunc(StringConstant), where StringConstant is
                defined with a "const" declaration and is not a
                typed constant.

      c. You can't evaluate procedures or functions that have
         structure VALUE parameters. You can evaluate procedures or
         functions that have structure VARIABLE parameters, though.

  2.  What should I be aware of when I am debugging multilanguage
      programs with Turbo Debugger?

      Turbo Debugger's default source language is "Source," which
      means it chooses the expression language based on the current
      source module. This can cause some confusion if your program
      has source modules written in different languages (like C
      and assembler). Since you are actually entering a language
      expression any time Turbo Debugger prompts you for a value
      or an address, this can cause some unexpected results:

      a. Even if you are in a CPU window or a Dump window, you
         must still enter addresses in the source language,
         despite the fact that the window is displaying in hex.
         For example, to display the contents of memory address
         1234:5678, you must type one of the following
         expressions, depending on your current source language:

          C            0x1234:0x5678
          Pascal        $1234:$5678
          Assembler     1234H:5678H

      b. When your current language is assembler, you must be
         careful when entering hex numbers, since they are
         interpreted EXACTLY as they would be in an assembler
         source file. This means that if you want to enter a
         number that starts with one of the hex digits A - F, you
         must first precede the letter with a 0 so Turbo Debugger
         knows you are entering a number. Likewise, if your number
         ends in B or D (indicating a binary or decimal number), you
         must add an H to indicate that you really want a hex number:

          OK:   0aaaa   123dh   89abh

          BAD:  aaaa    123d    89ab

  3.  Why does the text "Cannot be changed" come up when I do an
      assignment in the Data/Evaluate/Modify "New value" pane?

      If you use the Data/Evaluate/Modify command (Ctrl-F4) to
      change a variable by direct assignment, the "New value" pane
      will say "Cannot be changed." This doesn't mean the 
      assignment didn't take effect. What it does mean is that the
      assignment expression as a whole is not a memory-referencing
      expression whose value you can change by moving to the
      bottom pane. Here are some examples of direct assignment
      expressions:

        C              x = 4
        Pascal         ratio := 1.234
        Assembler      wval = 4 shl 2

      If you had typed just "x," "ratio," or "wval" into the top
      pane, then you would be able to move to the bottom pane and
      enter a new value. The direct assignment method using the
      "=" or ":=" assignment operator is quicker and more
      convenient if you don't care about examining the value of
      the variable before modifying it.


  4.  What could happen when global breakpoints are set on local
      variables?

      When you set global breakpoints using local variables, make
      sure the breakpoints are cleared before you exit the
      procedure or function that the variables are defined in. The
      best way to do this is to put a breakpoint on the last line
      of the procedure or function. If you do not clear the
      breakpoints, your program will break unexpectedly and may
      even hang on some machines because the breakpoints are being
      set in memory that is not currently being used by the
      procedure or function.


  5.  Why is execution slower when tracing (F7) than when stepping
      (F8) through my programs?

      TDW can do reverse execution, which means that when you are 
      tracing through your program, TDW could be saving all the 
      information about each source line you trace over. TDW only 
      saves this information in the Module window if you have chosen 
      View|Execution History and toggled the Full History local menu 
      command to 'Yes'. 

      If you want faster execution you can step over (F8) the instruction 
      or toggle the Full History option to 'No' in the Execution History 
      window. (Although reverse execution is always available in the 
      CPU view, you must toggle this option to 'Yes' for it to work 
      in the Module view.  The default setting in the Module view is 'No'.)

/************************* END OF FILE *****************************/

