Debugging with GDB: The GNU Source-Level Debugger

Overview

Debugging with GDB details the GNU GDB debugging utility. The purpose of a debugger such as GDB 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.

GDB 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.

* ...

See more details below
This Paperback is Not Available through BN.com
Sending request ...

Overview

Debugging with GDB details the GNU GDB debugging utility. The purpose of a debugger such as GDB 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.

GDB 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 happened when your program stopped.

* Change things in your program so you can experiment with correcting the effects of one bug and go on to learn about another.

You can use GDB to debug programs written in C or C++. This book is a printed version of the GDB documentation, available online from the Free Software Foundation.

Read More Show Less

Product Details

  • ISBN-13: 9780595149193
  • Publisher: iUniverse, Incorporated
  • Publication date: 12/28/2000
  • Edition number: 5
  • Pages: 224
  • Product dimensions: 7.47 (w) x 9.37 (h) x 0.49 (d)

Table of Contents

Summary of GDB 1
Free software 1
Contributors to GDB 2
A Sample GDB Session 4
Getting In and Out of GDB 10
Invoking GDB 10
Choosing files 11
Choosing modes 13
Quitting GDB 15
Shell commands 15
GDB Commands 17
Command syntax 17
Command completion 18
Getting help 20
Running Programs Under GDB 24
Compiling for debugging 24
Starting your program 25
Your program's arguments 26
Your program's environment 27
Your program's working directory 28
Your program's input and output 29
Debugging an already-running process 30
Killing the child process 31
Additional process information 31
Debugging programs with multiple threads 32
Debugging programs with multiple processes 35
Stopping and Continuing 36
Breakpoints, watchpoints, and exceptions 36
Setting breakpoints 37
Setting watchpoints 42
Breakpoints and exceptions 43
Deleting breakpoints 44
Disabling breakpoints 45
Break conditions 46
Breakpoint command lists 48
Breakpoint menus 49
Continuing and stepping 50
Signals 54
Stopping and starting multi-thread programs 56
Examining the Stack 58
Stack frames 58
Backtraces 59
Selecting a frame 61
Information about a frame 62
MIPS machines and the function stack 64
Examining Source Files 65
Printing source lines 65
Searching source files 68
Specifying source directories 68
Source and machine code 70
Examining Data 72
Expressions 72
Program variables 74
Artificial arrays 75
Output formats 77
Examining memory 78
Automatic display 81
Print settings 83
Value history 91
Convenience variables 92
Registers 94
Floating point hardware 96
Using GDB with Different Languages 97
Switching between source languages 97
List of filename extensions and languages 98
Setting the working language 99
Having GDB infer the source language 99
Displaying the language 100
Type and range checking 100
An overview of type checking 101
An overview of range checking 102
Supported languages 104
C and C++ 104
C and C++ operators 104
C and C++ constants 108
C++ expressions 108
C and C++ defaults 110
C and C++ type and range checks 110
GDB and C 110
GDB features for C++ 110
Modula-2 112
Operators 112
Built-in functions and procedures 115
Constants 118
Modula-2 defaults 119
Deviations from standard Modula-2 119
Modula-2 type and range checks 119
The scope operators :: and 120
GDB and Modula-2 120
Examining the Symbol Table 122
Altering Execution 127
Assignment to variables 127
Continuing at a different address 128
Giving your program a signal 129
Returning from a function 130
Calling program functions 130
Patching programs 131
GDB Files 132
Commands to specify files 132
Errors reading symbol files 137
Specifying a Debugging Target 139
Active targets 139
Commands for managing targets 140
Choosing target byte order 143
Remote debugging 143
The GDB remote serial protocol 144
What the stub can do for you 145
What you must do for the stub 146
Putting it all together 148
Communication protocol 150
Using the gdbserver program 152
Using the gdbserve.nlm program 154
GDB with a remote i960 (Nindy) 155
Startup with Nindy 155
Options for Nindy 155
Nindy reset command 156
The UDI protocol for AMD29K 156
The EBMON protocol for AMD29K 157
Communications setup 157
EB29K cross-debugging 159
Remote log 160
GDB with a Tandem ST2000 160
GDB and VxWorks 161
Connecting to VxWorks 162
VxWorks download 162
Running tasks 163
GDB and Sparclet 163
Setting file to debug 164
Connecting to Sparclet 165
Sparclet download 165
Running and debugging 165
GDB and Hitachi microprocessors 166
Connecting to Hitachi boards 166
Using the E7000 in-circuit emulator 167
Special GDB commands for Hitachi micros 167
GDB and remote MIPS boards 168
Simulated CPU target 170
Controlling GDB 172
Prompt 172
Command editing 172
Command history 173
Screen size 175
Numbers 176
Optional warnings and messages 177
Canned Sequences of Commands 179
User-defined commands 179
User-defined command hooks 181
Command files 182
Commands for controlled output 183
Using GDB under GNU Emacs 185
Reporting Bugs in GDB 189
Have you found a bug? 189
How to report bugs 189
Formatting Documentation 193
Installing GDB 195
Compiling GDB in another directory 197
Specifying names for hosts and targets 198
Configure options 199
Footnotes 201
GNU Free Documentation License 202
Table of Contents 202
GNU Free Documentation License 202
How to use this License for your documents 209
Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)