𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Debugging with GDB: The GNU Source-Level Debugger

✍ Scribed by Richard M. Stallman, Roland Pesch, Stan Shebs


Publisher
Free Software Foundation
Year
2002
Tongue
English
Leaves
329
Edition
9
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


The GNU Debugger allows you to see what is going on "inside" a program while it executes - or what a program was doing at the moment it crashed.GDB supports C, C++, Java, Fortran and Assembly among other languages; it is also designed to work closely with the GNU Compiler Collection (GCC).The GNU Debugger Program has four special features that helps you catch bugs in the act: It starts your program for you, specifying anything that might affect it's behavior. Makes your program stop under specified conditions. Examines what happened when the program stopped. Allows you to experiment with changes to see what effect they have on the program.This book will show you: setting and clearing breakpoints examining the stack, source files and data examining the symbol table altering program execution specifying a target for debugging how to control the debugger how to use canned command sequences how to install GDB* and much more!This manual is written for programmers. It is designed so someone can begin utilizing GDB after just reading the first chapter, or read the whole manual and master the program. Synopsis of ideas and extensive examples are given.

✦ Table of Contents


Debugging with GDB: the GNU Source-Level Debugger......Page 1
Copyright......Page 3
Table of Contents......Page 4
Summary of GDB......Page 12
Ch1 Sample GDB Session......Page 18
2.1 Invoking GDB......Page 22
2.1.1 Choosing files......Page 23
2.1.2 Choosing modes......Page 24
2.3 Shell commands......Page 26
3.2 Command completion......Page 28
3.3 Getting help......Page 30
4.2 Starting your program......Page 34
4.3 Your program's arguments......Page 35
4.4 Your program's environment......Page 36
4.6 Your program's input & output......Page 37
4.7 Debugging already-running process......Page 38
4.9 Debugging programs with multiple threads......Page 39
4.10 Debugging programs with multiple processes......Page 41
5.1 Breakpoints, watchpoints & catchpoints......Page 44
5.1.1 Setting breakpoints......Page 45
5.1.2 Setting watchpoints......Page 48
5.1.3 Setting catchpoints......Page 50
5.1.4 Deleting breakpoints......Page 51
5.1.5 Disabling breakpoints......Page 52
5.1.6 Break conditions......Page 53
5.1.7 Breakpoint command lists......Page 54
5.1.8 Breakpoint menus......Page 55
5.2 Continuing & stepping......Page 56
5.3 Signals......Page 59
5.4 Stopping & starting multi-thread programs......Page 61
6.1 Stack frames......Page 64
6.2 Backtraces......Page 65
6.3 Selecting frame......Page 66
6.4 Information about frame......Page 67
7.1 Printing source lines......Page 68
7.2 Searching source files......Page 69
7.4 Source & machine code......Page 70
8.1 Expressions......Page 74
8.2 Program variables......Page 75
8.3 Artificial arrays......Page 76
8.4 Output formats......Page 77
8.5 Examining memory......Page 78
8.6 Automatic display......Page 79
8.7 Print settings......Page 81
8.8 Value history......Page 86
8.9 Convenience variables......Page 87
8.10 Registers......Page 88
8.12 Memory region attributes......Page 89
8.12.1.2 Memory access size......Page 90
8.12.1.3 Data cache......Page 91
9.1.1 Create & Delete Tracepoints......Page 92
9.1.3 Tracepoint Passcounts......Page 93
9.1.4 Tracepoint Action Lists......Page 94
9.1.5 Listing Tracepoints......Page 95
9.2.1 tfind n......Page 96
9.2.2 tdump......Page 98
9.3 Convenience Variables for Tracepoints......Page 99
10.1 How Overlays Work......Page 102
10.2 Overlay Commands......Page 103
10.3 Automatic Overlay Debugging......Page 105
10.4 Overlay Sample Program......Page 106
11.1.1 List of filename extensions & languages......Page 108
11.2 Displaying language......Page 109
11.3.1 Overview of type checking......Page 110
11.3.2 Overview of range checking......Page 111
11.4 Supported languages......Page 112
11.4.1.1 C & C++ operators......Page 113
11.4.1.3 C++ expressions......Page 115
11.4.1.5 C & C++ type & range checks......Page 116
11.4.1.7 GDB features for C++......Page 117
11.4.2.1 Operators......Page 118
11.4.2.2 Built-in functions & procedures......Page 120
11.4.2.5 Deviations from standard Modula-2......Page 121
11.4.2.8 GDB & Modula-2......Page 122
11.4.3.1 How modes are displayed......Page 123
11.4.3.3 Values & their Operations......Page 125
11.4.3.4 Chill type & range checks......Page 127
11.4.3.5 Chill defaults......Page 128
Ch12 Examining Symbol Table......Page 130
13.1 Assignment to variables......Page 134
13.2 Continuing at different address......Page 135
13.4 Returning from function......Page 136
13.6 Patching programs......Page 137
14.1 Commands to specify files......Page 138
14.2 Errors reading symbol files......Page 143
15.2 Commands for managing targets......Page 146
15.4 Remote debugging......Page 148
15.5 Kernel Object Display......Page 149
16.1 Using gdbserver program......Page 150
16.2 Using gdbserve.nlm program......Page 151
16.3 Implementing remote stub......Page 152
16.3.2 What you must do for stub......Page 153
16.3.3 Putting it all together......Page 155
17.1.3 Features for Debugging DJGPP Programs......Page 158
17.1.4 Features for Debugging MS Windows PE executables......Page 160
17.2.1 Using GDB with VxWorks......Page 161
17.2.1.2 VxWorks download......Page 162
17.3.2 Hitachi H8/300......Page 163
17.3.2.1 Connecting to Hitachi boards......Page 164
17.3.2.2 Using E7000 ICE......Page 165
17.3.4 Intel i960......Page 166
17.3.5 Mitsubishi M32R/D......Page 167
17.3.8 MIPS Embedded......Page 168
17.3.11 Hitachi SH......Page 170
17.3.12.2 Connecting to Sparclet......Page 171
17.3.14 Tandem ST2000......Page 172
17.3.15 Zilog Z8000......Page 173
17.4.3 MIPS......Page 174
18.3 Command history......Page 176
18.5 Numbers......Page 178
18.6 Optional warnings & messages......Page 179
18.7 Optional messages about internal happenings......Page 180
19.1 User-defined commands......Page 182
19.2 User-defined command hooks......Page 183
19.3 Command files......Page 184
19.4 Commands for controlled output......Page 185
20.2 TUI Key Bindings......Page 188
20.3 TUI specific commands......Page 189
20.4 TUI configuration variables......Page 190
Ch21 Using GDB under GNU Emacs......Page 192
22.2 Server Prefix......Page 194
22.3 Values......Page 195
22.4 Frames......Page 196
22.6 Annotation for GDB Input......Page 198
22.8 Information on Breakpoints......Page 199
22.10 Running Program......Page 200
22.12 Annotations We might Want in Future......Page 201
23.1.1 GDB/MI Input Syntax......Page 202
23.1.2 GDB/MI Output Syntax......Page 203
23.1.3 Simple Examples of GDB/MI Interaction......Page 205
23.3.2 GDB/MI Stream Records......Page 206
23.4 GDB/MI Command Description Format......Page 207
23.5 GDB/MI Breakpoint table commands......Page 208
23.6 GDB/MI Data Manipulation......Page 216
23.7 GDB/MI Program control......Page 226
23.8 Miscellaneous GDB commands in GDB/MI......Page 236
23.9 GDB/MI Stack Manipulation Commands......Page 238
23.10 GDB/MI Symbol Query Commands......Page 243
23.11 GDB/MI Target Manipulation Commands......Page 246
23.12 GDB/MI Thread Commands......Page 251
23.14 GDB/MI Variable Objects......Page 253
24.2 How to report bugs......Page 258
25.2.1 Readline Bare Essentials......Page 262
25.2.3 Readline Killing Commands......Page 263
25.2.5 Searching for Commands in History......Page 264
25.3.1 Readline Init File Syntax......Page 265
25.3.2 Conditional Init Constructs......Page 269
25.4.2 Commands for Manipulating History......Page 273
25.4.3 Commands for Changing Text......Page 274
25.4.4 Killing & Yanking......Page 275
25.4.5 Specifying Numeric Arguments......Page 276
25.4.7 Keyboard Macros......Page 277
25.4.8 Some Miscellaneous Commands......Page 278
25.5 Readline vi Mode......Page 279
26.1.1 Event Designators......Page 280
26.1.3 Modifiers......Page 281
AppA Formatting Documentation......Page 284
AppB Installing GDB......Page 286
B.1 Compiling GDB in another directory......Page 287
B.3 Configure options......Page 288
AppC Maintenance Commands......Page 290
AppD GDB Remote Serial Protocol......Page 292
AppE GNU General Public License......Page 304
How to Apply These Terms to Your New Programs......Page 309
AppF GNU Free Documentation License......Page 312
Index......Page 318


πŸ“œ SIMILAR VOLUMES


Debugging with GDB: The GNU source-level
✍ Richard Stallman, Roland Pesch, et al Stan Shebs πŸ“‚ Library πŸ“… 2011 πŸ› GNU Press 🌐 English

<span>The GNU Debugger allows you to see what is going on "inside" a program while it executes - or what a program was doing at the moment it crashed. GDB supports C, C++, Java, Fortran and Assembly among other languages; it is also designed to work closely with the GNU Compiler Collection (GCC). Th

Debugging with Fiddler: The complete ref
✍ Eric Lawrence πŸ“‚ Library πŸ“… 2012 πŸ› CreateSpace Independent Publishing Platform 🌐 English

Fiddler is a Web Debugging Proxy platform that monitors and modifies web traffic. This freeware tool enables developers, testers, and enthusiasts to inspect traffic, set breakpoints, and Β«fiddleΒ» with incoming or outgoing data. Fiddler includes powerful event-based scripting, and can be extended usi

The Art of Debugging With GDB and DDD
✍ Norman Matloff πŸ“‚ Library πŸ“… 2013 🌐 English

Debugging is crucial to successful software development, but even many experienced programmers find it challenging. Sophisticated debugging tools are available, yet it may be difficult to determine which features are useful in which situations. The Art of Debugging is your guide to making the debugg

The Art of Debugging with GDB, DDD, and
✍ Norman Matloff, Peter Jay Salzman πŸ“‚ Library πŸ“… 2008 πŸ› No Starch Press 🌐 English

I must come clean first - I know the authors. Peter asked me to review one of the sections in the book many ages ago when the book was in its infancy. The book has progressed much since then, and I must admit this is much more than I was expecting from a book about debugging! Chapters 1 through 3