
Table of Contents
1. Debugging with gdb ........................................................................................................................ 1
2. Summary of gdb.............................................................................................................................. 3
2.1. Free software...................................................................................................................... 3
2.2. Free Software Needs Free Documentation ........................................................................ 3
2.3. Contributors to gdb ............................................................................................................ 4
3. A Sample gdb Session ..................................................................................................................... 7
4. Getting In and Out of gdb............................................................................................................ 11
4.1. Invoking gdb .................................................................................................................... 11
4.1.1. Choosing files ................................................................................................... 12
4.1.2. Choosing modes................................................................................................ 13
4.2. Quitting gdb ..................................................................................................................... 16
4.3. Shell commands............................................................................................................... 16
4.4. Logging output................................................................................................................. 16
5. gdb Commands ............................................................................................................................. 19
5.1. Command syntax ............................................................................................................. 19
5.2. Command completion...................................................................................................... 19
5.3. Getting help...................................................................................................................... 21
6. Running Programs Under gdb .................................................................................................... 25
6.1. Compiling for debugging................................................................................................. 25
6.2. Starting your program...................................................................................................... 25
6.3. Your program’s arguments............................................................................................... 26
6.4. Your program’s environment ........................................................................................... 27
6.5. Your program’s working directory................................................................................... 28
6.6. Your program’s input and output ..................................................................................... 28
6.7. Debugging an already-running process ........................................................................... 29
6.8. Killing the child process .................................................................................................. 29
6.9. Debugging programs with multiple threads..................................................................... 30
6.10. Debugging programs with multiple processes............................................................... 32
7. Stopping and Continuing ............................................................................................................. 35
7.1. Breakpoints, watchpoints, and catchpoints...................................................................... 35
7.1.1. Setting breakpoints............................................................................................ 35
7.1.2. Setting watchpoints........................................................................................... 38
7.1.3. Setting catchpoints............................................................................................ 40
7.1.4. Deleting breakpoints ......................................................................................... 41
7.1.5. Disabling breakpoints ....................................................................................... 42
7.1.6. Break conditions ............................................................................................... 43
7.1.7. Breakpoint command lists................................................................................. 44
7.1.8. Breakpoint menus ............................................................................................. 45
7.1.9. "Cannot insert breakpoints" .............................................................................. 46
7.2. Continuing and stepping .................................................................................................. 46
7.3. Signals.............................................................................................................................. 49
7.4. Stopping and starting multi-thread programs .................................................................. 51
8. Examining the Stack..................................................................................................................... 53
8.1. Stack frames..................................................................................................................... 53
8.2. Backtraces........................................................................................................................ 54
8.3. Selecting a frame.............................................................................................................. 55
8.4. Information about a frame ............................................................................................... 56
Summary of Contents for ENTERPRISE LINUX 3 - SECURITY GUIDE
Page 1: ...Red Hat Enterprise Linux 3 Debugging with gdb ...
Page 12: ...2 Chapter 1 Debugging with gdb ...
Page 28: ...18 Chapter 4 Getting In and Out of gdb ...
Page 34: ...24 Chapter 5 gdb Commands ...
Page 44: ...34 Chapter 6 Running Programs Under gdb ...
Page 68: ...58 Chapter 8 Examining the Stack ...
Page 98: ...88 Chapter 10 Examining Data ...
Page 112: ...102 Chapter 12 Tracepoints ...
Page 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Page 138: ...128 Chapter 14 Using gdb with Different Languages ...
Page 144: ...134 Chapter 15 Examining the Symbol Table ...
Page 170: ...160 Chapter 19 Debugging remote programs ...
Page 198: ...188 Chapter 21 Controlling gdb ...
Page 204: ...194 Chapter 22 Canned Sequences of Commands ...
Page 206: ...196 Chapter 23 Command Interpreters ...
Page 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Page 296: ...286 Chapter 27 gdb Annotations ...
Page 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Page 322: ...312 Chapter 30 Using History Interactively ...
Page 362: ...352 Appendix D gdb Remote Serial Protocol ...
Page 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Page 386: ...376 Appendix G GNU Free Documentation License ...
Page 410: ......