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
Содержание ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE
Страница 1: ...Red Hat Enterprise Linux 4 Debugging with gdb ...
Страница 12: ...2 Chapter 1 Debugging with gdb ...
Страница 28: ...18 Chapter 4 Getting In and Out of gdb ...
Страница 34: ...24 Chapter 5 gdb Commands ...
Страница 44: ...34 Chapter 6 Running Programs Under gdb ...
Страница 68: ...58 Chapter 8 Examining the Stack ...
Страница 98: ...88 Chapter 10 Examining Data ...
Страница 112: ...102 Chapter 12 Tracepoints ...
Страница 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Страница 138: ...128 Chapter 14 Using gdb with Different Languages ...
Страница 144: ...134 Chapter 15 Examining the Symbol Table ...
Страница 170: ...160 Chapter 19 Debugging remote programs ...
Страница 198: ...188 Chapter 21 Controlling gdb ...
Страница 204: ...194 Chapter 22 Canned Sequences of Commands ...
Страница 206: ...196 Chapter 23 Command Interpreters ...
Страница 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Страница 296: ...286 Chapter 27 gdb Annotations ...
Страница 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Страница 322: ...312 Chapter 30 Using History Interactively ...
Страница 362: ...352 Appendix D gdb Remote Serial Protocol ...
Страница 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Страница 386: ...376 Appendix G GNU Free Documentation License ...
Страница 410: ......