Debugging with DDD

Total Page:16

File Type:pdf, Size:1020Kb

Debugging with DDD Debugging with DDD User’s Guide and Reference Manual First Edition, for DDD Version 3.2 Last updated 2000-01-03 Andreas Zeller Debugging with DDD User’s Guide and Reference Manual Copyright c 2000 Universität Passau Lehrstuhl für Software-Systeme Innstraße 33 D-94032 Passau GERMANY Distributed by Free Software Foundation, Inc. 59 Temple Place – Suite 330 Boston, MA 02111-1307 USA ddd and this manual are available via the ddd www page. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the sections entitled “Copying” and “GNU General Public License” (see Appendix G [License], page 181) are included exactly as in the original, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. Send questions, comments, suggestions, etc. to [email protected]. Send bug reports to [email protected]. i Short Contents Summary of DDD .............................................. 1 1 A Sample DDD Session ...................................... 5 2 Getting In and Out of DDD ................................... 15 3 The DDD Windows ........................................ 39 4 Navigating through the Code .................................. 71 5 Stopping the Program ....................................... 79 6 Running the Program ....................................... 89 7 Examining Data .......................................... 103 8 Machine-Level Debugging ................................... 137 9 Changing the Program ...................................... 141 10 The Command-Line Interface ................................. 143 Appendix A Application Defaults ................................ 155 Appendix B Bugs and How To Report Them ......................... 165 Appendix C Configuration Notes ................................. 171 Appendix D Dirty Tricks ...................................... 175 Appendix E Extending DDD ................................... 177 Appendix F Frequently Answered Questions ......................... 179 Appendix G GNU General Public License ........................... 181 Appendix H Help and Assistance ................................. 189 Label Index ................................................ 191 Key Index ................................................. 195 Command Index ............................................. 197 Resource Index .............................................. 199 File Index .................................................. 203 Concept Index ............................................... 205 ii Debugging with DDD iii Table of Contents Summary of DDD .......................................... 1 About this Manual .................................................. 2 Free software ....................................................... 2 Getting DDD ....................................................... 2 Contributors to DDD ................................................ 3 History of DDD ..................................................... 3 1 A Sample DDD Session ................................... 5 1.1 Sample Program .............................................. 14 2 Getting In and Out of DDD .............................. 15 2.1 Invoking DDD ............................................... 15 2.1.1 Choosing an Inferior Debugger ...................... 15 2.1.2 DDD Options....................................... 16 2.1.3 X Options .......................................... 24 2.1.4 Inferior Debugger Options........................... 24 2.1.4.1 GDB Options ............................. 24 2.1.4.2 DBX and Ladebug Options ................ 25 2.1.4.3 XDB Options ............................. 25 2.1.4.4 JDB Options .............................. 25 2.1.4.5 PYDB Options ............................ 26 2.1.4.6 Perl Options .............................. 27 2.1.5 Multiple DDD Instances............................. 27 2.1.6 X warnings ......................................... 27 2.2 Quitting DDD ................................................ 27 2.3 Persistent Sessions............................................ 28 2.3.1 Saving Sessions..................................... 28 2.3.2 Resuming Sessions.................................. 29 2.3.3 Deleting Sessions ................................... 30 2.3.4 Customizing Sessions ............................... 31 2.4 Remote Debugging ........................................... 31 2.4.1 Running DDD on a Remote Host .................... 31 2.4.2 Using DDD with a Remote Inferior Debugger ........ 31 2.4.2.1 Customizing Remote Debugging ........... 32 2.4.3 Debugging a Remote Program ....................... 33 2.5 Customizing Interaction with the Inferior Debugger ............ 33 2.5.1 Invoking an Inferior Debugger ....................... 33 2.5.2 Initializing the Inferior Debugger .................... 34 2.5.2.1 GDB Initialization ........................ 34 2.5.2.2 DBX Initialization ........................ 35 2.5.2.3 XDB Initialization ........................ 35 2.5.2.4 JDB Initialization ......................... 35 iv Debugging with DDD 2.5.2.5 PYDB Initialization ....................... 36 2.5.2.6 Perl Initialization.......................... 36 2.5.2.7 Opening the Selection ..................... 36 2.5.3 Communication with the Inferior Debugger .......... 36 3 The DDD Windows ..................................... 39 3.1 The Menu Bar ................................................ 39 3.1.1 The File Menu ...................................... 40 3.1.2 The Edit Menu...................................... 41 3.1.3 The View Menu..................................... 42 3.1.4 The Program Menu ................................. 43 3.1.5 The Commands Menu............................... 44 3.1.6 The Status Menu.................................... 45 3.1.7 The Source Menu ................................... 45 3.1.8 The Data Menu ..................................... 46 3.1.9 The Maintenance Menu ............................. 47 3.1.10 The Help Menu.................................... 48 3.1.11 Customizing the Menu Bar ......................... 48 3.1.11.1 Auto-Raise Menus ....................... 48 3.1.11.2 Customizing the Edit Menu............... 49 3.2 The Tool Bar ................................................. 49 3.2.1 Customizing the Tool Bar ........................... 51 3.3 The Command Tool........................................... 53 3.3.1 Customizing the Command Tool ..................... 55 3.3.1.1 Disabling the Command Tool .............. 55 3.3.2 Command Tool Position............................. 56 3.3.2.1 Customizing Tool Decoration .............. 57 3.4 Getting Help ................................................. 57 3.5 Undoing and Redoing Commands ............................. 58 3.6 Customizing DDD ............................................ 58 3.6.1 How Customizing DDD Works ...................... 58 3.6.1.1 Resources................................. 58 3.6.1.2 Changing Resources....................... 59 3.6.1.3 Saving Options............................ 59 3.6.2 Customizing DDD Help ............................. 59 3.6.2.1 Button Tips ............................... 59 3.6.2.2 Tip of the day ............................. 60 3.6.2.3 Help Helpers.............................. 60 3.6.3 Customizing Undo .................................. 61 3.6.4 Customizing the DDD Windows ..................... 62 3.6.4.1 Splash Screen ............................. 62 3.6.4.2 Window Layout ........................... 63 3.6.4.3 Customizing Fonts ........................ 64 3.6.4.4 Toggling Windows ........................ 66 3.6.4.5 Text Fields ................................ 67 3.6.4.6 Icons ..................................... 67 3.6.4.7 Adding Buttons ........................... 68 3.6.4.8 More Customizations...................... 68 v 3.6.5 Debugger Settings .................................. 68 4 Navigating through the Code ............................. 71 4.1 Compiling for Debugging ..................................... 71 4.2 Opening Files ................................................ 71 4.2.1 Opening Programs .................................. 71 4.2.2 Opening Core Dumps ............................... 72 4.2.3 Opening Source Files ............................... 72 4.2.4 Filtering Files....................................... 73 4.3 Looking up Items ............................................. 73 4.3.1 Looking up Definitions.............................. 73 4.3.2 Textual Search ...................................... 74 4.3.3 Looking up Previous Locations ...................... 74 4.3.4 Specifying Source Directories ....................... 74 4.4 Customizing the Source Window .............................. 75 4.4.1 Customizing Glyphs ................................ 76 4.4.2 Customizing Searching.............................. 77 4.4.3 Customizing Source Appearance..................... 77 4.4.4 Customizing Source Scrolling ....................... 78 4.4.5 Customizing Source Lookup......................... 78 4.4.6 Customizing File Filtering........................... 78 5 Stopping
Recommended publications
  • The Focus - Issue 36
    Contents The Focus - Issue 36 A Publication for ANSYS Users Contents Feature Articles ● Linux & ANSYS: Lessons Learned ● Backup Tool ● Design Modeler FAQ On the Web ● APDL Customization course notes now available for purchase ● ANSYS and MathCAD ● ANSYS Acquires Century Dynamics Resources ● PADT Support: How can we help? ● Upcoming Training at PADT ● About The Focus ❍ The Focus Library ❍ Contributor Information ❍ Subscribe / Unsubscribe ❍ Legal Disclaimer http://www.padtinc.com/epubs/focus/common/contents.asp [3/28/2005 9:06:12 AM] Linux & ANSYS: Lessons Learned The Focus - Issue 36 A Publication for ANSYS Users Linux & ANSYS: Lessons Learned by Eric Miller, PADT Every couple of years, the computing picture for analysts gets turned upside down. For a long time now the industry has been moving from Unix workstations to Windows/Intel desktop machines. The wintel price/performance has been fantastic, the IT guys are happier, and all of that productivity software that you spend so much time with runs in the same spot. We have been happy with a stable and known environment. However, accepting the fact that unless you work for a big company that can buy some Unix servers, you just don’t have an easy way to get some extra horsepower other then getting a new box. Then along comes this Finnish guy that may or may not have been named after Lucy’s little brother. With not much of a life and a very large brain, he popped out the majority of a complete and free version of Unix that anyone can use, breaking the stranglehold of (expensive) proprietary Unix OS’s that ran on (expensive) proprietary hardware.
    [Show full text]
  • An Introduction to PWF Linux
    An Introduction to PWF Linux Dr MJ Rutter [email protected] Michaelmas 2001 Typeset by FoilTEX °c 2001 MJ Rutter UNIX Development of UNIX started in 1969 in AT&T Bell Labs. Version 1, written in assembler, appeared in 1971. A couple of years later it was rewritten in the new C language, also developed by Bell Labs. In 1975 UNIX was made available outside Bell Labs. By the early 1990s it was the operating system for largish computers. Cray, DEC, HP, IBM, SGI and Sun all sold versions with their computers. None of its competitors achieved this level of cross-platform support. Competitors included MVS (IBM only), VMS (DEC only) and WinNT (effectively Intel only). 1 Linux Linux famously started being developed by a Finnish graduate student, Linus Torvalds, in 1991. It was intended to be a UNIX variant running on Intel i386- based PCs. From an early stage Linus made the source freely available and encouraged others to contribute. In 1994 version 1 was released, followed by 1.2 a year later, and 2.0 the following year. By this time support had grown to include Macintoshes and Alphas as well as PCs. The current version is 2.4, released in 2001, and development continues. 2 The Computer Resources The computers in the Physics PWF and in the CS-run PWFs in the centre of Cambridge all run a version of Linux which contains all the software needed for this course. These computers use the same Novell server for your home directories that they do when running Windows.
    [Show full text]
  • Linux Installation and Getting Started
    Linux Installation and Getting Started Copyright c 1992–1996 Matt Welsh Version 2.3, 22 February 1996. This book is an installation and new-user guide for the Linux system, meant for UNIX novices and gurus alike. Contained herein is information on how to obtain Linux, installation of the software, a beginning tutorial for new UNIX users, and an introduction to system administration. It is meant to be general enough to be applicable to any distribution of the Linux software. This book is freely distributable; you may copy and redistribute it under certain conditions. Please see the copyright and distribution statement on page xiii. Contents Preface ix Audience ............................................... ix Organization.............................................. x Acknowledgments . x CreditsandLegalese ......................................... xii Documentation Conventions . xiv 1 Introduction to Linux 1 1.1 About This Book ........................................ 1 1.2 A Brief History of Linux .................................... 2 1.3 System Features ......................................... 4 1.4 Software Features ........................................ 5 1.4.1 Basic commands and utilities ............................. 6 1.4.2 Text processing and word processing ......................... 7 1.4.3 Programming languages and utilities .......................... 9 1.4.4 The X Window System ................................. 10 1.4.5 Networking ....................................... 11 1.4.6 Telecommunications and BBS software .......................
    [Show full text]
  • Pipenightdreams Osgcal-Doc Mumudvb Mpg123-Alsa Tbb
    pipenightdreams osgcal-doc mumudvb mpg123-alsa tbb-examples libgammu4-dbg gcc-4.1-doc snort-rules-default davical cutmp3 libevolution5.0-cil aspell-am python-gobject-doc openoffice.org-l10n-mn libc6-xen xserver-xorg trophy-data t38modem pioneers-console libnb-platform10-java libgtkglext1-ruby libboost-wave1.39-dev drgenius bfbtester libchromexvmcpro1 isdnutils-xtools ubuntuone-client openoffice.org2-math openoffice.org-l10n-lt lsb-cxx-ia32 kdeartwork-emoticons-kde4 wmpuzzle trafshow python-plplot lx-gdb link-monitor-applet libscm-dev liblog-agent-logger-perl libccrtp-doc libclass-throwable-perl kde-i18n-csb jack-jconv hamradio-menus coinor-libvol-doc msx-emulator bitbake nabi language-pack-gnome-zh libpaperg popularity-contest xracer-tools xfont-nexus opendrim-lmp-baseserver libvorbisfile-ruby liblinebreak-doc libgfcui-2.0-0c2a-dbg libblacs-mpi-dev dict-freedict-spa-eng blender-ogrexml aspell-da x11-apps openoffice.org-l10n-lv openoffice.org-l10n-nl pnmtopng libodbcinstq1 libhsqldb-java-doc libmono-addins-gui0.2-cil sg3-utils linux-backports-modules-alsa-2.6.31-19-generic yorick-yeti-gsl python-pymssql plasma-widget-cpuload mcpp gpsim-lcd cl-csv libhtml-clean-perl asterisk-dbg apt-dater-dbg libgnome-mag1-dev language-pack-gnome-yo python-crypto svn-autoreleasedeb sugar-terminal-activity mii-diag maria-doc libplexus-component-api-java-doc libhugs-hgl-bundled libchipcard-libgwenhywfar47-plugins libghc6-random-dev freefem3d ezmlm cakephp-scripts aspell-ar ara-byte not+sparc openoffice.org-l10n-nn linux-backports-modules-karmic-generic-pae
    [Show full text]
  • The Data Display Debugger Ddd [−−Gdb] [−−Dbx] [−−Xdb] [−−Jdb]
    () () NAME ddd, xddd - the data display debugger SYNOPSIS ddd [ −−gdb ][−−dbx ][−−xdb ][−−jdb ][−−pydb ][−−perl ][−−debugger name ][−−[r]host [username@]hostname ]] [−−help ][−−trace ][−−version ][−−configuration ][options... ] [ program [ core | process-id ]] but usually just ddd program DESCRIPTION The purpose of a debugger such as DDD is to allow you to see what is going on “inside” another program while it executes—or what another program was doing at the moment it crashed. DDD can do four main kinds of things (plus other things in support of these) to help you catch bugs in the act: • Start your program, specifying anything that might affect its behavior. • Make your program stop on specified conditions. • Examine what has happened, when your program has stopped. • Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another. “Classical” UNIX debuggers such as the GNU debugger (GDB) provide a command-line interface and a multitude of commands for these and other debugging purposes. DDD is a comfortable graphical user interface around an inferior GDB, DBX, XDB, JDB, Python debugger, or Perl debugger. INVOKING DDD You can run DDD with no arguments or options. However, the most usual way to start DDD is with one argument or two, specifying an executable program as the argument: ddd program You can also start with both an executable program and a core file specified: ddd program core You can, instead, specify a process ID as a second argument, if you want to debug a running process: ddd program 1234 would attach DDD to process 1234 (unless you also have a file named ‘ 1234 ’; DDD does check for a core file first).
    [Show full text]
  • SAS on Unix/Linux- from the Terminal to GUI
    SAS on Unix/Linux- from the terminal to GUI. L Gakava & S Kannan – October 2015 Agenda All about the terminal o Customising your terminal o Basic Linux terminal commands o Running SAS in non-interactive mode o Available SAS file editors o What to look out for on Unix/Linux platform All about Graphical User Interface (GUI) o Launching SAS GUI. o Changing SAS default behaviour o SAS ToolBox commands o SAS editor commands. Motivation - Why Use SAS On Unix/Linux? Using SAS on UNIX/Linux Platform o Company migrating to UNIX/Linux o Joining a company which is using SAS on the Linux platform Challenge Too many commands to learn! Why Use SAS On Unix/Linux o Customising Linux sessions will ensure you increase work efficiency by taking advantage of the imbedded Linux tools. In general transferring and running large files will be quicker in Linux compared to PC*. Terminal What to expect when you login? % pwd /home/username % ls Customise: Update .bashrc file with this line PS1='$IV $PWD$EE> ' will change your prompt to show the following: /home/username> Terminal Navigation Command Meaning ls list files and directories ls -a list all files and directories mkdir make a directory cd directory change to named directory cd change to home-directory cd ~ change to home-directory cd .. change to parent directory Terminal Navigation Command Meaning cp file1 file2 copy file1 and call it file2 mv file1 file2 move or rename file1 to file2 rm file remove a file rmdir directory remove a directory cat file display a file less file display a file a page at a time head file display the first few lines of a file tail file display the last few lines of a file grep 'keyword' file search a file for keywords count number of lines/words/ wc file characters in file Terminal useful commands How do you find out if a version of a file has changed? /home/username>diff file1.txt file2.txt Command to compare two files.
    [Show full text]
  • Qtile Documentation Release 0.6
    Qtile Documentation Release 0.6 Aldo Cortesi January 13, 2015 Contents 1 Installing 3 2 Configuration 5 3 Commands and scripting 7 4 Reference 9 5 Miscellaneous 11 5.1 Installing Qtile.............................................. 11 5.2 Installing on Arch Linux......................................... 11 5.3 Installing on Debian........................................... 12 5.4 Installing on Funtoo........................................... 13 5.5 Installing on Gentoo........................................... 16 5.6 Installing from Source.......................................... 17 5.7 Installing on Ubuntu........................................... 18 5.8 Configuration............................................... 18 5.9 Default Configuration.......................................... 19 5.10 Running Inside Gnome.......................................... 20 5.11 Groups.................................................. 21 5.12 Hooks................................................... 22 5.13 Keys................................................... 22 5.14 Layouts.................................................. 23 5.15 Mouse.................................................. 23 5.16 Screens.................................................. 24 5.17 Starting Qtile............................................... 24 5.18 Commands API............................................. 24 5.19 Object Graph............................................... 25 5.20 Keys................................................... 26 5.21 qsh...................................................
    [Show full text]
  • Section 2: a Quick Window Manager and Unix Tutorial
    2. A quick windowmanager and Unix tutorial (This section last updated August 2012) This section provides •some "getting started" pointers on the graphical windowing environments you will be using, primar- ily on the ECMC Linux system in the room 52 studio, but also with some references and comparisons to comparable Mac OSX and Windows procedures; and •anintroduction to some basic Unix commands and utility programs that can be run from a shell windowonECMC Linux and Macintosh music production systems As noted in section 1, the core of a computer operating system, which implements the most basic sys- tem protocols and operations, is called the kernel.The open source Linux kernel is developed and main- tained by an international group of thousands of volunteers under the direction of Linus Torvalds, who wrote much of the first Linux kernel, modeled after the functionality of Unix operating systems, during the early 1990s. The Linux kernel is updated several times each year,and includes both a stable branch, designed for most users (likeus), and a developmental branch, used by Linux developers to test newfea- tures before theyare incorporated into stable versions of the kernel. Technically,the term "Linux"refers only to an operating system kernel developed by the team of Linux Project programmers under Torvolds’ direction. The GNU (pronounced "ga-NOO") Project is a non- profit organization that supports the development of a broad range of open source applications, without which the Linux kernel would be useless. Manyusers of GNU software on Linux kernels prefer to call their operating system GNU Linux or GNU/Linux.Incommon usage, however, the term Linux often is used loosely to refer to all GNU operating system components as well as the Linux kernel.
    [Show full text]
  • Answers to Selected Problems
    Answers to selected problems Chapter 4 1 Whenever you need to find out information about a command, you should use man. With option -k followed by a keyword, man will display commands related to that keyword. In this case, a suitable keyword would be login, and the dialogue would look like: $ man -k login ... logname (1) - print user’s login name ... The correct answer is therefore logname.Tryit: $ logname chris 3 As in problem 4.1, you should use man to find out more information on date. In this case, however, you need specific information on date, so the command you use is $ man date The manual page for date is likely to be big, but this is not a problem. Remember that the manual page is divided into sections. First of all, notice that under section SYNOPSIS the possible format for arguments to date is given: NOTE SYNOPSIS date [-u] [+format] The POSIX standard specifies only two This indicates that date may have up to two arguments, both of arguments to date – which are optional (to show this, they are enclosed in square some systems may in brackets). The second one is preceded by a + symbol, and if you addition allow others read further down, in the DESCRIPTION section it describes what format can contain. This is a string (so enclose it in quotes) which 278 Answers to selected problems includes field descriptors to specify exactly what the output of date should look like. The field descriptors which are relevant are: %r (12-hour clock time), %A (weekday name), %d (day of week), %B (month name) and %Y (year).
    [Show full text]
  • 1. Why POCS.Key
    Symptoms of Complexity Prof. George Candea School of Computer & Communication Sciences Building Bridges A RTlClES A COMPUTER SCIENCE PERSPECTIVE OF BRIDGE DESIGN What kinds of lessonsdoes a classical engineering discipline like bridge design have for an emerging engineering discipline like computer systems Observation design?Case-study editors Alfred Spector and David Gifford consider the • insight and experienceof bridge designer Gerard Fox to find out how strong the parallels are. • bridges are normally on-time, on-budget, and don’t fall ALFRED SPECTORand DAVID GIFFORD • software projects rarely ship on-time, are often over- AS Gerry, let’s begin with an overview of THE DESIGN PROCESS bridges. AS What is the procedure for designing and con- GF In the United States, most highway bridges are budget, and rarely work exactly as specified structing a bridge? mandated by a government agency. The great major- GF It breaks down into three phases: the prelimi- ity are small bridges (with spans of less than 150 nay design phase, the main design phase, and the feet) and are part of the public highway system. construction phase. For larger bridges, several alter- There are fewer large bridges, having spans of 600 native designs are usually considered during the Blueprints for bridges must be approved... feet or more, that carry roads over bodies of water, preliminary design phase, whereas simple calcula- • gorges, or other large obstacles. There are also a tions or experience usually suffices in determining small number of superlarge bridges with spans ap- the appropriate design for small bridges. There are a proaching a mile, like the Verrazzano Narrows lot more factors to take into account with a large Bridge in New Yor:k.
    [Show full text]
  • Porting X/Motif Applications to Qt
    PPoorrttiinngg XX//MMoottiiff AApppplliiccaattiioonnss ttoo QQtt ® Scenarios and Advice for a Smooth Migration Integrated Computer Solutions Incorporated The User Interface Company™ 54 B Middlesex Turnpike Bedford, MA 01730 617.621.0060 [email protected] www.ics.com ® Porting X/Motif Applications to Qt Scenarios and Advice for a Smooth Migration Table of Contents Introduction......................................................................................................................... 4 Reasons for porting......................................................................................................... 4 Evaluating the state of your application.......................................................................... 4 Anatomy of an application.................................................................................................. 5 Hello Motif, Hello Qt...................................................................................................... 6 Toolkit Comparison ............................................................................................................ 7 Widget-set comparison ................................................................................................... 7 Mapping of common UI objects ................................................................................. 7 Menus and Options ..................................................................................................... 8 Dialogs .......................................................................................................................
    [Show full text]
  • Universal Ctags Documentation Release 0.3.0
    Universal Ctags Documentation Release 0.3.0 Universal Ctags Team 22 September 2021 Contents 1 Building ctags 2 1.1 Building with configure (*nix including GNU/Linux)........................2 1.2 Building/hacking/using on MS-Windows..............................4 1.3 Building on Mac OS.........................................7 2 Man pages 9 2.1 ctags.................................................9 2.2 tags.................................................. 33 2.3 ctags-optlib.............................................. 40 2.4 ctags-client-tools........................................... 46 2.5 ctags-incompatibilities........................................ 53 2.6 ctags-faq............................................... 56 2.7 ctags-lang-inko............................................ 62 2.8 ctags-lang-iPythonCell........................................ 62 2.9 ctags-lang-julia............................................ 63 2.10 ctags-lang-python.......................................... 65 2.11 ctags-lang-r.............................................. 69 2.12 ctags-lang-sql............................................. 70 2.13 ctags-lang-tcl............................................. 72 2.14 ctags-lang-verilog.......................................... 73 2.15 readtags................................................ 76 3 Parsers 81 3.1 Asm parser.............................................. 81 3.2 CMake parser............................................. 81 3.3 The new C/C++ parser........................................ 82 3.4 The
    [Show full text]