AD -- Ada debugging utility     Version: 29.VIII.1998


version française
latest changes
Purpose:
Easy post-mortem debugging while programming in Ada GNAT/DOS.
Shows unhandled exception call stack with source filenames, line numbers, unit names, subunit names, parameters and the source code lines (including generic code). This program is only an interface with the GNU debugger, GDB.EXE.
AD is free software, entirely programmed in Ada, with GNAT.

Installation:
Copy AD.EXE and AD_SIPH.EXE into a directory reachable by the DOS, e.g. where the executables of the GNAT compiler are.
Type "path" to have the list of these directories; "path /?" or "help path" to know how to change it.

How to use it:
Type AD to see usage and options (or see below).
Compile your program with the -g debug option, e.g. type "gnatmake -g myprog.adb" .
This will produce myprog.exe (for direct execution) and myprog (for debugging).
  • If you type "monprog", the program runs without saying where an eventual exception occurs.
  • If you type "ad monprog", you will see the call stack in case of exception; with "ad /s myprog" you'll see also the Ada source code involved; the "/p" switch is for subunit names and parameters.

Remarks:
  • If you want to see the source code (/S switch), it must be in a directory reachable by the GNAT compiler: the current directory, or one of the directories stored in the ADA_INCLUDE_PATH environment variable.
  • The source code indicated by GBD for a generic unit is the one that is instanciated. Remedy: if you suspect a bug in a generic unit, instanciate it as an independant unit:
                truc.ads:     package Truc is new Machin(...);
    
    AD will then find the original generic unit.
  • The file GDB.INI is ignored by AD and thus remains unchanged.
  • If the program seems blocked, try to type "q" and [return].
  • The /V option restores the correct text mode before the display of the results - useful for exceptions during graphics... (20.I.1998)
  • Meaning of the log files:
    - AD.LOG is the output screen of AD (useful in graphic mode without /V option);
    - AD_GDB.LOG is the output of GDB;
    - AD_FILES.LOG is a list with lines numbers and complete file names.
    This file is concieved for an integrated environment like AdaCAPS (in a future version) or EDIT, a tiny editor made by the author, where AD results and compilation errors analysis is built-in - [informations here]; EDIT.EXE can be found in directory UTILITY in the AD.ZIP archive or downloaded from here.
    N.B.: format of AD_FILES.LOG changed since 17.IX.1997 version.
  • Tested with GNAT 3.07 and 3.10p for DOS, under DR-DOS 1 7.02, MS-DOS 6.22 and MS-DOS 7.10 + Win 4.0 (Win 95 OSR 2).
  • Under Norton Commander 2 you can associate the extensionless executables with the AD command; add in the extension file a line like:
       : ad /S /P /L /WH:\ !
    (in this example, H: is a RAM disk drive)

Usage and options:
Usage: AD [language] {/option} progname [prog. parameters]
Options:
           /P        show subunit names and parameters
           /S        show source code
           /L        make log files (AD.LOG, AD_FILES.LOG, AD_GDB.LOG)
           /Wa_dir   work directory:= `a_dir' (e.g. a ramdisk)
           /V        restore video mode
Language: one of the following:
  ENGLISH  FRANCAIS

Latest changes:
  • Early 1998: options: restore video mode, work directory
  • 25.VII.1998: runs with executables outside current directory (path specified or found in DOS' PATH list)
  • 29.VIII.1998: displays "wild" exceptions (faults etc.)

New versions:
Download AD.ZIP from author's page
http://www.unine.ch/math/personnel/assistants/Gautier/Gaut_FTP.htm
or from EZ2OLAD site: ftp://ftp.seas.gwu.edu/pub/ada/ez2load

Author:
Gautier de Montmollin
e-mail:Gautier.deMontmollin@Maths.UniNe.CH
internet:http://www.unine.ch/math/personnel/assistants/Gautier/Montmollin.html
Improvements (for NT usage) by:
Martin C. Carlisle, Asst Prof of Comp Sci,
US Air Force Academy, mcc@cs.usafa.af.mil
http://www.usafa.af.mil/dfcs/bios/carlisle.html

(1) DR-DOS: free "sequel" of DR DOS 6, Novell DOS 7 and OpenDOS 7.01, with multitasking, downloadable from this site. To run GNAT and other programs of the DJGPP family, it is necessary to unactivate DR-DOS' DPMI server (option in setup or command "dpmi off" e.g. in autoexec.bat). N.B.: GNAT runs correctly (including multitasking mode) from DR-DOS version 7.02 - please upgrade if necessary.
(2) You can download a good shareware clone of NC, Volkov Commander with this link.