home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************************/
- TURBO DEBUGGER 2.0 COMMON QUESTIONS AND ANSWERS
- -----------------------------------------------
-
- Below is a list of the most commonly asked questions about Turbo Debugger.
- Following this list is an explanation of some of the new mouse features
- in Turbo Debugger 2.0.
-
- 1. How does TD handle screen output for graphics- and text-based
- programs?
-
- Turbo Debugger has a number of strategies that it can use to
- control how and when the screen gets refreshed. If you are
- debugging a program that uses a graphics display mode, if
- you want to use Borland pop-up utilities such as SideKick
- and SideKick Plus while inside Turbo Debugger, or if you want to
- run programs from Turbo Debugger's DOS Shell that write
- directly to video memory, you should review the following tips.
-
- The default screen-updating mode is "Flip"; this means that
- Turbo Debugger uses an alternate video display page on
- adapters that support multiple display pages. This results
- in fast screen-swapping between Turbo Debugger and your
- program, but it also can interfere with the operation of
- pop-up utilities and graphics programs.
-
- Pop-up utilities may not appear on the screen, even though
- they are active and processing your keystrokes. You must
- select "Swap" mode for display updating in order for these
- programs to work properly. Use Turbo Debugger's -ds command-line
- option to do this, or use the TDINST utility to permanently
- set this mode. "Swap" mode makes screen updating slower, but
- it makes sure that Turbo Debugger's screen does not interfere
- with either your program's or any other program's display.
-
- You may also need to use "Swap" when you use the DOS Shell
- command or run an editor from within TD. Most programs
- expect to run on video page 0, and do not check to see what
- the current video page is. TD's DOS Shell and any editors
- that TD runs in "Flip" mode do not run from video page 0,
- and the programs may appear to hang, even though you will be
- able to type in keystrokes normally. If this happens, use
- the -ds command-line option when you run TD or reinstall TD
- to use "Swap" instead of "Flip."
-
- If you are debugging a graphics mode application, you must
- specify the -ds command-line option ("Swap" contents) and
- you may want to use Turbo Debugger's -vg command-line
- option (Graphics Save). This causes additional memory to be
- set aside for saving the entire graphics image your
- program produces. If you don't use this option, a "red
- cloud" may appear on your program's screen. These options
- can also be set permanently by using the TDINST program.
- The Graphics Save option takes an additional 8K of memory
- and slows screen-swapping.
-
- If you are running a graphics program that changes the EGA
- palette, make sure you use the -vp command-line option to
- save the palette.
-
- 2. Can Turbo Debugger execute other programs while you are
- still using the debugger?
-
- The DOS Shell and Edit commands in the Module and File
- windows can swap the program you are debugging to disk in
- order to make room to run DOS or your editor. The default
- amount of memory to swap is 128K. You can use TDINST to set a
- different amount if that's not enough memory to run your
- editor or other programs. Setting the swap size to 0K tells
- Turbo Debugger to swap the entire user program to disk
- before running the DOS command processor.
-
- Only your program gets swapped to disk; Turbo Debugger
- remains in memory.
-
- 3. How can I break out of a program even though interrupts are
- disabled?
-
- If you have an 80386-chip-based computer and are using
- TD386, option -B allows break even when interrupts are
- disabled. For example, this option enables a break from
-
- CLI
- JMP $
-
- 4. Why can't I press Ctrl-Break to get out of a program
- running on a remote machine?
-
- The program running in the remote machine has taken control
- of Interrupt 1B (Ctrl-Break). TDREMOTE does not take back
- control of Interrupt 1B until you stop execution of the
- running program on the debugger side by completing the
- program or pressing Ctrl-F2 (Program Reset).
-
-
- 5. What are some of the syntactic and parsing differences
- between Turbo Debugger's built-in assembler and the
- standalone Turbo Assembler?
-
- A discussion follows this short example program:
-
- .model small
- .data
-
- abc struc
- mem1 dd ?
- mem2 db ?
- mem3 db " "
- abc ends
-
- align 16
- a abc <1,2,"xyz">
-
- msg1 db "testing 1 2 3", 0
- msg2 db "hello world", 0
- nmptr dw msg1
- fmptr dd msg1,msg2
- nfmptr dw fmptr
- xx dw seg a
-
- .code
-
- push cs
- pop ds
- mov bx,offset a
- mov bx,nmptr
- les si,fmptr
- mov ah,4ch
- int 21h
- end
-
- The assembler expression parser does not accept all legal
- TASM instruction operands. This allows TD's assembler
- expressions to be more general and allows multiple levels of
- memory-referencing, more like that used in C and Pascal.
- However, there are a few constructs that you may be used to
- that you'll have to specify differently for the TD assembler
- expression parser to accept them:
-
- a. Size overrides should always appear inside the
- brackets; PTR is optional after the size. Also, when
- referring to a structure, you must use the name of the
- struc, not the name of the variable:
-
- OK: [byte ptr bx] [dword si] [abc bx]
-
- BAD: byte ptr[bx] [struc abc bx] [a bx]
-
- b. You must specify a structure name when accessing the
- members of a structure via a register pointer:
-
- OK: [abc ptr bx].mem1 [abc bx].mem3 + 1
-
- BAD: [bx].mem1
-
- c. You can't use multiple instances of [] unless they are
- adjacent, and you can only follow an [] expression with
- a dot and a structure member name or another []
- expression:
-
- OK: 4[bx][si] [abc bx].mem2
-
- BAD: [bx]4[si] [bx]+4
-
- d. If you use a register as part of a memory expression
- and you don't specify a size, WORD is assumed:
-
- [bx] is the same as [word bx]
-
- e. You can use any register you want between [], not just
- the combinations of BX, BP, SI, and DI allowed in
- instruction operands:
-
- OK: [ax+bx] [bx+sp]
-
- f. You can use multiple levels of [] to follow chains of
- pointers:
-
- OK: [byte [[nfmptr]+4]]
-
- g. Be careful using registers to access memory locations.
- You may get unexpected results if your segment
- registers are not set up properly. If you don't
- explicitly specify a segment register, Turbo Debugger
- uses the DS register to reference memory.
-
- h. When you do specify a segment register, make sure you
- follow the same rule for size overrides: put it
- INSIDE the brackets:
-
- OK: [byte es:di] [es:fmptr]
-
- BAD: es:[byte di]
-
- i. Use the OFFSET operator to get the address of a
- variable or structure. Turbo Debugger automatically
- supplies the [] around a variable name if you just type
- the variable name alone:
-
- a contents of structure a
- [a] contents of structure a
- offset a address of structure a
-
- j. You can use the type overrides and the format control
- count to examine any area of memory displayed as you
- wish:
-
- [byte es:bx],10 10 bytes pointed to by es:bx
- [dword ds:si],4 4 dwords pointed to by ds:si
-
- This is very useful when specifying watch expressions.
-
- k. Sometimes you use a word memory location or register to
- point to a paragraph in memory that contains a data
- structure. Access the structure with expressions like
-
- [abc [xx]:0].mem1
- [abc es:0].mem3
-
- 6. Are there any syntactic or parsing differences between Turbo
- Debugger's C expression evaluation and Turbo C++'s?
-
- You can't pass constant-string arguments when evaluating
- functions.
-
- OK: myfunc(123) myfunc(string_variable)
-
- BAD: myfunc("constant")
-
- 7. 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.
-
- 8. 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 1234:5678
-
- 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
-
- 9. 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.
-
- 10. Why does an inspector occasionally display question marks
- when inspecting a Turbo C++ register variable?
-
- If you inspect a register variable that is not in the
- current scope, you'll see ???? for the value. A register
- variable only displays a value if the register is in your
- current scope (valid at the current location in your
- program).
-
- 11. What is the most likely reason for Turbo Debugger to hang
- when starting up on a PC-compatible computer?
-
- If your computer is a Tandy 1000A, IBM PC Convertible, or
- NEC MultiSpeed, or if TD hangs when loading on your system,
- run TDINST and change the item in the Options\Miscellaneous
- menu so that NMI Intercept is not set. Some computers use
- the NMI (Non-Maskable Interrupt) in ways that conflict with TD,
- so you must disable TD's use of this interrupt in order to
- run the program.
-
- Also, if you are using a 80386-based machine and have the
- SuperKey utility loaded, be careful not to press a key when
- TD386 is loading, since SuperKey may capture the keystroke
- and cause unexpected results.
-
- 12. 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.
-
- 13. How can I save options set in TDINST to TD286.EXE?
-
- If you have a configuration file (tdconfig.td) already made for
- TD.EXE, TD286.EXE will automatically use this configuration file.
- You can save a configuration made in TDINST to TD286.EXE directly
- if you state this on the command line. For instance,
-
- TDINST TD286.EXE
-
- When you want to save this configuration in TDINST, just select
- Save\Modify td.exe.
-
- 14. Why is execution is slower when tracing (F7) than when stepping
- (F8) through my programs?
-
- Turbo Debugger now has the capability for reverse execution. This
- means that when you are tracing through your program TD is saving
- all the information about the source line you just traced over. If
- you want faster execution you can (F8) step over the instruction or
- toggle the Full History option to 'No' in the Execution History
- window.
-
-
- * Common questions about using mouse support in Turbo Debugger 2.0.
-
- Turbo Debugger 2.0 now provides mouse support that allows you to manipulate
- elements within the user interface. The following lists mouse-related
- terms to help you become accustomed to using Turbo Debugger's mouse support.
-
- If you have a mouse driver installed by default, Turbo Debugger and TDINST
- will try to use your mouse. If you do not wish to use your mouse during a
- debugging session, you can use the command-line switch '-p-' to turn the
- mouse off. This can also be set in TDINST in the Options\Input & prompting
- dialog box.
-
- Clicking and Dragging
- Most mice provide two or three buttons that allow for various
- functions inside an application. In Turbo Debugger you can,
- among other things, use the left mouse button to select options,
- move items around on the screen, and set breakpoints. The right
- mouse button has some of the same functionality as the left mouse
- button, but you can also open local menus within windows using
- this button. Double clicking the mouse on options in a list will
- select that item. For instance, in the File|Open dialog box you
- can highlight a file by clicking the mouse once on the file
- name. You can load the file by double clicking on the name.
- The commands shown at the bottom of the screen, like F1-Help,
- can also be selected using the mouse. Dragging the mouse consists
- of depressing the mouse button and moving the mouse cursor to a
- new location.
-
- Mouse drivers
- Your mouse driver is the application that you install to make your
- mouse active inside Turbo Debugger and other programs. Most mouse
- drivers will work with Turbo Debugger but may have to be updated
- to a newer version if you are having problems using an older version.
- If you have problems with the mouse once you have loaded TD or
- TDINST, you might try using the Display Swap option that can be
- specified either in TDINST or on the command-line with the -ds
- switch. Consult your mouse manual to ensure proper use of the
- mouse and its driver. Early versions of mouse drivers don't support
- screen display modes larger than 80 columns by 24 lines. As a result,
- your mouse driver might not work correctly when you use Turbo Debugger's
- enhanced display modes EGA 80x43, VGA 80x50, or EGA/VGA graphics modes.
-
- Scroll bars
- Scroll bars, located at the right and bottom of all windows, allow you
- to specify a new position within a window by clicking the mouse on an
- indicator on the scroll bar and dragging it to a new location. Arrows
- located at either end of a scroll bar also allow you to scroll through
- the window when you click and hold the mouse on the arrow heads.
-
- Icons
- An icon is a window that has been shrunk down to a smaller
- representation of the window. These icons can be moved with the
- mouse by clicking on the border of the icon and dragging it to a
- new location. Arrows located at the top right of each viewer allow
- you to zoom and unzoom the viewer when you click the mouse on the
- arrows. When you iconize a window, it is stored at the bottom right
- side of the screen. If any other windows are currently showing at
- this position the icon will be put behind that window. The global
- Window menu allows you to pick from a list of currently open windows.
- This will also take you to an iconized window.
-
- Resize box
- The resize box is located at the bottom right of each window. You can
- click the mouse on the box and drag the mouse to resize the viewer.
- Using the mouse you can also resize the viewer by clicking the mouse
- on the right border of any window and dragging it. Windows and
- inspectors can be moved using the mouse by clicking on the top and
- left borders and dragging the window to a new location. Double clicking
- the mouse on the top border is a short cut to zoom/unzoom the current
- window.
-
- Dialog boxes
- Dialog boxes allow you to select options, specify files to save or
- restore, and choose different settings. You can click the mouse to
- make prompts or panes within the dialog box active. Help for the
- current dialog box is available in by clicking on the Help button
- in the box.
-
- Close buttons
- A Close button is located at the top left of all windows and dialog
- boxes. It lets you close the current window or dialog box when you
- click the mouse on it. If you have entered any information into a
- dialog box and you use the Close button to close it, the settings
- you specified in the dialog box will not be saved. This is the same
- as clicking the mouse on the Cancel button inside a dialog box. You
- must select the OK button in dialog boxes in order to save these
- settings.
-