1.1 1 of 5 Integrating SNiFF+ with the Data Display Debugger (DDD) 1. Introduction In this paper we will describe the integration of SNiFF+ with the Data Display Debugger (DDD). First we will start with an overview of DDD, its benefits and key-features. Later, the more technical aspects of the installation, set-up and usage will be covered. Please refer to the last page of this document for a screen-shot of a sample debugging session with SNiFF+ and DDD. 2. What is the Data Display Debugger? The Data Display Debugger (DDD) is a common graphical user interface for GDB, DBX, and XDB, the popular UNIX debuggers. Besides "classical" front-end features such as viewing source texts, DDD provides a graphical data display, where data structures are displayed as graphs. A simple mouse click dereferences pointers or views structure contents, updated each time the program stops. Using DDD, you can reason about your application by viewing its data, not just by viewing it execute lines of source code. Other DDD features include - Debugging of programs written in C, C++, Ada, Fortran, Pascal, Modula-2, or Modula-3. - Machine-level debugging. - Hypertext source navigation and lookup. - Breakpoint, backtrace, and history editors. - Preferences and settings editors. - Program execution in terminal emulator window. - Debugging on remote host. - On-line manual. - Interactive help on the Motif user interface. - GDB/DBX/XDB command-line interface with full editing, history, search, and completion capabilities. DDD is a free software, protected by the GNU general public license. It is actively maintained by its authors, Dorothea Luetkehaus and Andreas Zeller at the Software Technology Dept., Technische Universitaet Braunschweig, Germany.
1.1 2 of 5 2.1 Where can I get DDD? To obtain the current version of DDD, please download it from the official world-wide-web site. The official DDD site can be found at: http://www.cs.tu-bs.de/softech/ddd/ This page is maintained by the authors of DDD and covers every conceivable information, including precompiled DDD binaries. Configuration of these include alpha-dec-osf3.2, mips-dec-ultrix4.4, hppa1.1-hphpux10.20, i586-pc-linux-gnu, i386-unknown-netbsd1.2e, sparc-sun-solaris2.4, and sparc-sun-sunos4.1.4. To download the SNiFF+ DDD integration, please visit TakeFive s FTP server: ftp://ftp.takefive.co.at/pub/sniff/integrations/ddd 3. Integration Details DDD is delivered as a full-fledged debugging environment with a debugger console, a source viewer and a data display. Since SNiFF+ has its own debugger console and source viewer (the SNiFF+ Source Editor), we employ DDD for producing graphical representations of variable and object values. For example, a user might want to set breakpoints with SNiFF+ s Source Editor and view a dynamically linked list displayed in DDD s Data Window while stepping through the program. 3.1 Installing DDD 1. Change to the download directory of DDD. cd <path_of_ddd_download> 2. Extract DDD. gunzip ddd-3.0.tar.gz tar xvf ddd-3.0.tar 3. Create a DDD configuration on your system. Please refer to the Readme file and the installation instructions provided with DDD. These are the minimum installation steps: cd ddd-3.0./configure make The DDD executable will be created in directory ddd-3.0/ddd. The name of the DDD executable is platform dependent, e.g. ddd-3.0-sparc-sun-solaris2.5. You might want to strip symbolic information generated by the compiler in order to reduce disk usage, for example: strip ddd/ddd-3.0-sparc-sun-solaris2.5
1.1 3 of 5 4. SNiFF+ searches the path for a DDD executable called ddd-3.0. We suggest that you create a symbolic link in your SNiFF+ installations directory. If you have followed the minimum installation instructions above type: cd $SNIFF_DIR/bin ln -s <path_to_your_ddd_installation>/ddd/ddd-3.0-sparc-sunsolaris2.5 ddd-3.0 5. Copy the contents of the dddcustommenus file delivered with this integration into your SiteMenus.sniff file or $HOME/.sniffrc/UserMenus.sniff file for site-wide or user-specific settings. 6. In the executable ddd/sniffddd, modify the name of the file which should be executed. If you followed the instructions above, it should become: exec ddd-3.0 7. Please do not forget to precise the adress of sniffddd and ddd-3.0 in the PATH. 3.2 Setting up SNiFF+ 1. Start SNiFF+ and select the Preferences menu. 2. Select the Platform node. 3. In the platform list, select the one you intend to use. Set it writable and press Adanced. 3. Select a debugger adaptor, e.g. "gdb 4". 4. In field debugger executable add sniffddd in front of the debuggers name: sniffddd gdb For example, if you are working on an AIX machine and your debugger of choice is DBX, you would select "dbx (AIX)" as debugger adaptor and enter sniffddd dbx as debugger executable. Sniffddd is a wrapper to the DDD and passes dbx as an option for the inferior debugger. Please note, that sniffddd recognizes only gdb, dbx and xdb as options. 6. Apply these changes. You can either choose this platform as default one, or select it when creating the working environments. 7. Close the Preferences menu.
1.1 4 of 5 4. Debugging a Program with SNiFF+ and DDD Compile your application as usual. After you ve selected "Debug <program>" from the Target menu, the debugger button-bar will be inserted in the Source Editor and the SNiFF+ Debugger Console will come up. In addition, a new empty DDD Data Window will appear. Set a breakpoint and let your application run. Now you might want to display object and variable values. Select a symbol in the Editor and choose "Display Symbol" from the DDD menu in the Source Editor. The symbol s name and value will be displayed in DDD s Data Window. Select more symbols in SNiFF+ and display them in the Data Window. DDD commands available from the custom menu in SNiFF+: - Display Symbol - Display Stack - Display Where - Display Arguments - Display Local Variables 4.1 Customizing DDD DDD reads resources from a.dddinit file in your home directory. Here are a few entries you might find convenient: Ddd*.geometry: +20+350 Ddd*source_view_shell.height: 50 Ddd*source_form_w.height: 50 Ddd*dddinitVersion: 2.1 4.2 More about DDD 1. DDD - A Free Graphical Front-End for UNIX Debuggers (ddd-paper.ps) A six-page DDD survey including some screen shots. The paper also highlights some internal aspects of DDD. Included in the DDD source distribution. 2. DDD - The Data Display Debugger (ddd.man.ps) The DDD manual page, in PostScript format. The official, up-to-date DDD reference. The PostScript version includes more than 30 screen shots highlighting DDD usage. Included in the DDD source distribution. 3. DDD - The Data Display Debugger (ddd.man-nopics.ps) The DDD manual page, in PostScript format, but without pictures. Use this version if your printer has trouble printing "ddd.man.ps". Included in the DDD source distribution.
1.1 5 of 5 5. Sample Debugging Session with SNiFF+ and DDD