[comp.lang.c] Turbo C debugger

Aron_Fingers_Nelson@cup.portal.com (09/10/87)

To all,

   I just thought that you all might like knowing about this.
   If any of you are on compuserve, you might want to suggest that
   he keep on developing this program. Since I am not on compuserve could
   anyone monitoring David's Tcdebug explorations keep me informed?
   David is the same programmer that wrote Tdebug plus and it is a very
   good T-pascal debugger. (2.0 should be great!) Hope he keeps
   on developing Tcdebug.
   He has my support!

      Aron_fingers_nelson@cup.portal.com

      August 9, 1987

                             TCdebug Version 0.00

                    (C) Copyright 1987 by L. David Baldwin.
                             All Rights Reserved.

  Further copyright information given below


  OVERVIEW

  TCdebug is an experimental source code debugger for use in debugging Turbo
  C (tm) Programs on the IBM-PC (tm).  Its goal is to allow source code
  debugging in all of Turbo C's memory models and with most of the possible
  compile and link options.  TCdebug allows you to:

       1.  View your source code (and, optionally, the assembly language
           code) while debugging.
       2.  Trace the operation of your program by source code lines or by
           assembly language instructions.
       3.  Insert breakpoints in your program by function name, by line
           number, or hexadecimal address.
       4.  Examine (and change) simple global variables by symbolic name.
           Local variables may also be examined and changed, but require that
           the proper displacement on the stack be known.
       5.  Set up a Watch window to keep continuous tabs on a variable.

  TCdebug is not a finished program.  It is being released at this time to
  get an indication of interest and to obtain assistance in finding bugs and
  problems which are probably numerous at this time.

  TCdebug is designed exclusively for debugging Turbo C programs.  It should
  not be used on programs generated by other compilers.


  SYSTEM REQUIREMENTS

       1.  An IBM-PC, AT, or compatible.  Screen compatibility is a must.
       2.  PC-DOS 2.0 or above.
       3.  Approximately 128k more memory than would normally be required to
           run the program to be tested.


  PREPARATION

  TCdebug requires that a Map file for your program be present to supply
  information on the program symbols and line number locations.  When
  compiling and linking with TC, the options can be set with O/C/C/L and
  O/L/M/P.  With TCC use -M and -y.




                                      1











  When starting a debugging session, the following files should be on the
  default drive:

    PROG.EXE    (or, optionally, .COM for the Tiny Model)
    PROG.MAP    the map file
    various.C   all the source files for the program (or at least all that
                will be accessed.)



  OPERATION

  TCdebug may be started by entering the filename of the program to be
  debugged and any parameters that the program requires on the command line
  as:

    TCdebug PROG <other stuff>

  Here, PROG is the name of the program to be tested with EXE being the
  default extension.  <other stuff> will be passed on to PROG as its command
  line when execution begins.  If TCdebug is called without parameters, a
  request will be made for them.

  When execution begins, TCdebug loads the Map file, the EXE file and reports
  some facts about the program.  Note should be made of whether pointers are
  regarded as Near or Far by default as this will be important when
  displaying pointers later.

  After "hitting any key", the program is executed to "main()" and the
  debugging screen appears.  The debugging screen is divided into two parts.
  The lower section is the command and data section.  The '*' is a prompt for
  one of the commands described later.  The top part of the screen displays
  the program source code text which at this point will be centered at the
  first statement in main().  Source code line number appear on the left and
  the current line (the one to be executed next) is highlighted.

  Dividing the two portions of the debugging screen is a line which shows the
  name of the source file presently displayed.
 
  Two keys which can be tried at this point are the F9 and F10 keys.  The 
  F9 key toggles into and out of the assembly mode.  When in assembly mode, 
  the assembly language instructions of the program are displayed with the 
  source code lines interspersed.  The F10 key toggles between the debugger 
  screen and the screen which receives program output.
 
 
  SPECIAL KEYS FOR VIEWING TEXT
 
  The following keys may be used to change the text being displayed:
 
       Pg Up
       Pg Dn       Move the display up or down one page.
 
 
                                      2
 
 
 
 
 
 
 
 
 
 
 
 
       ^Pg Up
       ^Pg Dn      Move to the start or end of the current file.
 
       Up arrow
       Down arrow  Scroll up or down one line.
 
       ^Left Arrow  (with Scroll Lock on)
       ^Right Arrow (with Scroll Lock on)
                   Scroll horizontally left and right.
 
       F9 key      Toggle in and out of assembly mode.
 
       F10 key     Toggle between the debug screen and the screen
                   of the program under test.
 
  In addition, the text being displayed may be changed using the View command 
  described later.
 
 
  COMMAND EDITOR
 
  Commands are entered at the '*' prompt.  When entering commands, the 
  following keys may used to edit the command:  (They perform the same
  functions as they do in the Turbo C editor.)

       ^A,^S,^D,^F,^G,^T,^H,^V,^Y,LFARW,RTARW,^LFARW,^RTARW,
       Ins, Del, Backspace

  The Insert mode (default) is indicated by a slightly fatter cursor.  The
  cursor is normal in the Overwrite mode.

  In addition, a stack of the last 6 commands (those having more than 3
  characters) is maintained.  The F3 key accesses the stored commands from
  the most recent to the oldest and the F5 key accesses them in the reverse
  order.  These old commands may be used as is or may be modified by editing
  them.

  Note that commands are not acted upon until the Enter key is hit.  (The
  cursor does not have to be at the line end to enter the command.)
 
 
  COMMAND PARAMETERS
 
  TCdebug uses one or two letter commands.  The command is often followed by 
  one or more parameters.  Parameters are delimited from the command and each 
  other using spaces.  The one exception to this is the format parameter 
  which is preceded by a comma.  The parameters which may be used are:
 
 
 
 
 
 
                                      3
 
 
 
 
 
 
 
 
 
 
 
    <Symbol>
       A C source code symbol representing a function name or variable as 
       appropriate. The leading underbar added by the compiler has been 
       stripped off, so symbols are entered exactly as used in the source 
       program.  Case is significant.
 
    <Line Number>
       Line numbers are entered as <filename>\<number> as:
           myprog.c\345
 
       In most cases, the <filename> part can be dropped.  An entry of the 
       form
 
           \345
 
       implies line number 345 in the currently displayed source file.  
       (Currently, the '\' also may be dropped and a simple decimal entry will 
       do.  However, the '\' may be required in future versions.)
 
    <Hexaddress>
       Normal numerical entry in TCdebug is decimal with hex entries allowed 
       by preceding them with '0x'.  However, numerical address entries must 
       be entered in hex to distinguish them from line numbers.  A 
       <hexaddress> takes the following form:
 
           0x1234:0x1ABC
           es:bx+2
           SS:BP-0X5a
 
       As indicated above, register names are allowed in address 
       specifications.  The _current_ value in the register is used--the 
       address does not change if the register value later changes.  The 
       segment part of the <hexaddress> may be dropped as in:
 
           bp-0xA
           0x123
           bx
 
       If no segment is present in the entry, there is an implied segment.  
       The rules for determining the implied segment are:
 
       1.  If the BP register is used, SS is implied.
       2.  If BX,SI,DI are used (but not BP), DS is implied.
       3.  If none of the above and a data entry is expected, DS is implied.
       4.  If a code address is expected, the current CS is implied.
 
    <Format>
       Format parameters are entered as one or two letters preceded by a 
       comma.  Case is significant.  The purpose of the <format> parameter is 
       to inform TCdebug of the size and type of a variable as this 
       information is not available in the Map file.  <format> parameters 
       correspond to those used in the C 'printf' and 'scanf' functions.  
 
 
                                      4
 
 
 
 
 
 
 
 
 
 
 
       Currently supported are:
 
           c,s,i,d,u,x,X,o,p,g,G,li,ld,lx,lX,lo,Np,Fp,lg,lG
 
       For the p (pointer) format, the default pointer size for the selected 
       memory model is used.  This size is indicated in the information 
       presented at startup.  To override the default, use either N or F as 
       appropriate.
 
       The c (character) format has been used as a catchall for byte size 
       items.  Display is in quoted character form, decimal, and hex.  Change 
       entries may be made using any of those forms.
 
 
  COMMANDS
 
  G    (Go)
 
    Format:
       G [<parameter> [<parameter..]]
 
    The Go command starts execution of the program under test.  Execution 
    will continue until a breakpoint is reached or the program terminates.
 
    One or more breakpoints may be entered with the Go command.  These 
    breakpoints are called temporary breakpoints as they are in effect only 
    until the first stopping point is reached.  Any temporary breakpoint 
    would then have to reentered with the next Go command if desired.
 
    Examples:
 
       G   Start execution with no temporary breakpoints. (There might be 
           some permanent breakpoints, however.)
 
       G \345 funct1 0x113
           Start execution with temporary breakpoints at line number 345, at 
           the start of function, funct1, and at address CS:0x113. In 
           addition, there might be other permanent breakpoints in effect.
 
  T    (Trace)
 
    Format:
       T   (or F7 key)
 
    In source code mode, execute the code on the current line.  Execution 
    will stop at the next encountered line number.  If the current line 
    contains a function call, the break will be at the start of the 
    function.
 
    In assembly mode (assembly code is displayed), execute the next assembly 
    language instruction.
 
 
 
                                      5
 
 
 
 
 
 
 
 
 
 
 
 
  N    (Next)
 
    Format:
       N    (or F8 key)
 
    In source code mode, execute the code on the current line in its 
    entirety.  In assembly mode, this command currently does nothing.
 
    The difference between the Trace and the Next command is that if the 
    current line contains a function call, Next will completely execute the 
    function whereas Trace will Trace through the function.
 
 
  P    (Permanent breakpoint)
 
    Format:
       [-]P [<parameter>]
 
    The P command is used to specify permanent breakpoints.  Unlike temporary 
    breakpoints, permanent breakpoints remain in effect until removed (using 
    a '-' preceding the P command).  
 
    If no parameter is entered, the breakpoints in effect are listed.
 
    Passcounts are not implemented at this time.
 
    Examples:
 
       P              List all permanent breakpoints.
      -P              Delete all permanent breakpoints.
       P moda.c\345   Install a breakpoint at line 345 in file moda.c.
      -P funct1       Remove a breakpoint at function funct1.
       P 0x34b        Install a breakpoint at CS:034B.
 
 
  V    (View text)
 
    Format:
       V [<parameter>]
 
    The View command may be used to change the text being observed 
    in the text window.  If no parameter is entered, the text will 
    be centered around the current line.
 
    Examples:
 
       V initscreens   View text at function initscreens.
       V \545          View text around line 545.
 
 
 
 
 
                                      6
 
 









  VF   (View File)

    Format:
       VF <filename>

    The View command is for viewing the program source files.  The VF
    command allows any ASCII file to be displayed.

You Get the Idea!!!!!
Guess you can reach him at Balwin, COmpuserve ID # 76327,53.

darrylo@hpsrlc.UUCP (09/11/87)

In comp.lang.c, Aron_Fingers_Nelson@cup.portal.com writes:

> To all,
> 
>    I just thought that you all might like knowing about this.
>    If any of you are on compuserve, you might want to suggest that
>    he keep on developing this program. Since I am not on compuserve could
>    anyone monitoring David's Tcdebug explorations keep me informed?
>    David is the same programmer that wrote Tdebug plus and it is a very
>    good T-pascal debugger. (2.0 should be great!) Hope he keeps
>    on developing Tcdebug.
>    He has my support!
> 
>       Aron_fingers_nelson@cup.portal.com
> 
>       August 9, 1987
     [ ... ]
> 

     I'd like to point out that, as the program is in the testing stage
(i.e., users are really testers at this point), TCDEBUG can, CURRENTLY,
only be downloaded from Compuserve.  IT CANNOT BE UPLOADED TO OTHER
BULLETIN BOARDS, USENET, ETC..  The reason for this is to prevent (well,
try to prevent) people from distributing "pre-release" versions all over
the known world.  Apparently, Dave Baldwin has had problems with early
released versions of his other programs; to this day, people ask him
questions about these early versions (e.g., he receives complains about
bugs in these early versions, bugs which have been fixed in the current
ones).

     I imagine that, once TCDEBUG has been debugged, these distribution
restrictions will be lifted, and people will then be free to distribute
TCDEBUG.

     -- Darryl Okahata
	{hplabs!hpcea!, hpfcla!} hpsrla!darrylo
	CompuServe: 75206,3074

Disclaimer: the above is the author's personal opinion and is not the
opinion or policy of his employer or of the little green men that
have been following him all day.