• Complain

Arnold Robbins - GDB Pocket Reference: Debugging Quickly & Painlessly With GDB

Here you can read online Arnold Robbins - GDB Pocket Reference: Debugging Quickly & Painlessly With GDB full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    GDB Pocket Reference: Debugging Quickly & Painlessly With GDB
  • Author:
  • Genre:
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

GDB Pocket Reference: Debugging Quickly & Painlessly With GDB: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "GDB Pocket Reference: Debugging Quickly & Painlessly With GDB" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Arnold Robbins: author's other books


Who wrote GDB Pocket Reference: Debugging Quickly & Painlessly With GDB? Find out the surname, the name of the author of the book and a list of all author's works by series.

GDB Pocket Reference: Debugging Quickly & Painlessly With GDB — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "GDB Pocket Reference: Debugging Quickly & Painlessly With GDB" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
GDB Pocket Reference
Arnold Robbins
Editor
Mike Loukides

Copyright 2009 O'Reilly Media, Inc.

OReilly Media SPECIAL OFFER Upgrade this ebook with OReilly for more - photo 1

O'Reilly Media

SPECIAL OFFER: Upgrade this ebook with OReilly

for more information on this offer!

Please note that upgrade offers are not available from sample content.

Chapter 1. GDB Pocket Reference
Introduction

The GNU Debugger, GDB, is the standard debugger on GNU/Linux and BSD systems and can be used on just about any Unix system with a C compiler and at least one of several well-known object file formats. It can also be used on other kinds of systems as well. GDB has a very rich feature set, making it the preferred debugger of many developers the world over.

This pocket reference provides a complete summary of GDB command-line syntax, initialization files, expressions, variables, and commands. It also describes the source code locations for GDB and two other graphical debuggers based on GDB.

A full introduction to GDB may be found in itsa documentation, which is included in the source code. This documentation is also available from the Free Software Foundation in Debugging with GDB: The GNU Source-Level Debugger, by Richard M. Stallman, Roland Pesch, Stan Shebs, et al.

Conventions Used in This Book

This book follows the typographic conventions that are outlined below:

Constant width

Used for directory names, commands, program names, functions, variables, and options. All terms shown in constant width are typed literally. It is also used to show the contents of files or the output from commands.

Constant width italic

Used in syntax and command summaries to show generic text; these should be replaced with user-supplied values.

Constant width bold

Used in examples to show text that should be typed literally by the user.

Italic

Used to show generic arguments and options; these should be replaced with user-supplied values. Italic is also used to indicate URLs, macro package names, filenames, comments in examples, and the first mention of terms.

$

Used in some examples as the Bash, Bourne or Korn shell prompt.

program ( N )

Indicates the "manpage" for program in section N of the online manual. For example, echo (1) means the entry for the echo command.

[ ]

Surround optional elements in a description of syntax. (The brackets themselves should never be typed.) Note that many commands show the argument [ files ]. If a filename is omitted, standard input (usually the keyboard) is assumed. End keyboard input with an end-of-file character.

^x

indicates a "control character," typed by holding down the Control key and the x key for any key x .

|

Used in syntax descriptions to separate items for which only one alternative may be chosen at a time.

Conceptual Overview

A debugger is a program that lets you run a second program, which we will call the debuggee. The debugger lets you examine and change the state of the debuggee, and control its execution. In particular, you can single-step the program, executing one statement or instruction at a time, in order to watch the program's behavior.

Debuggers come in two flavors: instruction-level debuggers, which work at the level of machine instructions, and source-level debuggers, which operate in terms of your program's source code and programming language. The latter are considerably easier to use, and usually can do machine-level debugging if necessary. GDB is a source-level debugger; it is probably the most widely applicable (portable to the largest number of architectures) of any current debugger.

GDB itself provides two user interfaces: the traditional command-line interface (CLI) and a text user interface (TUI). The latter is meant for regular terminals or terminal emulators, dividing the screen into separate "windows" for the display of source code, register values, and so on.

GDB provides support for debugging programs written in C, C++, Objective C, Java,[] and Fortran. It provides partial support for Modula-2 programs compiled with the GNU Modula-2 compiler and for Ada programs compiled with the GNU Ada Translator, GNAT. GDB provides some minimal support for debugging Pascal programs. The Chill language is no longer supported.

When working with C++ and Objective C, GDB provides name demangling. C++ and Objective C encode overloaded procedure names into a unique "mangled" name that represents the procedure's return type, argument types, and class membership. This ensures so-called type-safe linkage. There are different methods for name mangling, thus GDB allows you to select among a set of supported methods, besides just automatically demangling names in displays.

If your program is compiled with the GNU Compiler Collection (GCC), using the -g3 and -gdwarf-2 options, GDB understands references to C preprocessor macros. This is particularly helpful for code using macros to simplify complicated struct and union members. GDB itself also has partial support for expanding preprocessor macros, with more support planned.

GDB allows you to specify several different kinds of files when doing debugging:

  • The exec file is the executable program to be debuggedi.e., your program.

  • The optional core file is a memory dump generated by the program when it dies; this is used, together with the exec file, for postmortem debugging. Core files are usually named core on commercial Unix systems. On BSD systems, they are named program.core. On GNU/Linux systems, they are named core.PID, where PID represents the process ID number. This lets you keep multiple core dumps, if necessary.

  • The symbol file is a separate file from which GDB can read symbol information: information describing variable names, types, sizes, and locations in the executable file. GDB, not the compiler, creates these files if necessary. Symbol files are rather esoteric; they're not necessary for run-of-the-mill debugging.

There are different ways to stop your program:

  • A breakpoint specifies that execution should stop at a particular source code location.

  • A watchpoint indicates that execution should stop when a particular memory location changes value. The location can be specified either as a regular variable name or via an expression (such as one involving pointers). If hardware assistance for watchpoints is available, GDB uses it, making the cost of using watchpoints small. If it is not available, GDB uses virtual memory techniques, if possible, to implement watchpoints. This also keeps the cost down. Otherwise, GDB implements watchpoints in software by single-stepping the program (executing one instruction at a time).

  • A catchpoint specifies that execution should stop when a particular event occurs.

The GDB documentation and command set often use the word breakpoint as a generic term to mean all three kinds of program stoppers. In particular, use the same commands to enable, disable, and remove all three.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «GDB Pocket Reference: Debugging Quickly & Painlessly With GDB»

Look at similar books to GDB Pocket Reference: Debugging Quickly & Painlessly With GDB. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «GDB Pocket Reference: Debugging Quickly & Painlessly With GDB»

Discussion, reviews of the book GDB Pocket Reference: Debugging Quickly & Painlessly With GDB and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.