下载  >  开发技术  >  C  > gdb调试官方文档

gdb调试官方文档 评分:

gdb调试官方文档官方文档,PDF清晰版,带目录,文字可选择。
Table of Contents Summary of GDB..… Free Software Free Software Needs free documentation Contributors to gdB 3 1 A Sample GDB Session 2 Getting In and Out of GDB 11 2.1 Invoking gdB 2.1.1 Choosing Files 12 2.1.2 Choosing Modes.......... 13 2.1.3 What GDB Does During Startup 16 2.2 Quitting GDB 17 3 Shell co 17 2. 4 Logging o 3 GDB Commands 申非 19 3.1 Command Syntax 3.2 Command Completion 3.3 Getting Help 着着·着鲁香垂,垂 22 4 Running Programs Under GDB 25 4.1 Compiling for Debugging 25 4.2 Starting your PrograM ,,26 4.3 Your Program's arguments 30 4.4 Your Programs Environment 30 4.5 Your Programs Working Directory 31 4.6 Your Program's Input and Output 32 4.7 Debugging an Alrcady-running Proccss 33 4.8 Killing the child process 34 4.9 Debugging Multiple Inferiors and Programs 34 4.10 Debugging Programs with Multiple Threads 37 4.11 Debugging Forks 41 4.12 Setting a Bookmark to Return to Later .44 4.12.1 A Non-obvious Benefit of Using Checkp OInts ugging with GDB 5 Stopping and Continuing 47 5. 1 Breakpoints, Watchpoints, and Calchpoinls 47 5.1.1 Setting Breakpoints 18 5.1.2 Setting Watchpoints 54 5.1.3 Setting Catchpoints 56 5.1. 4 Deleting Breakpoints ·;···.······ 61 5.1.5 Disabling Breakpoints 62 5.1.6 Break Conditions .63 5.1.7 Breakpoint Command Lists 65 5.1.8 Dynamic Printf 66 5.1.9 How to save breakpoints to a file 67 5.1.10 Static Probe Points ...68 5.1.11 Cannot insert breakpoints 69 5.1.12“ Breakpoint address adjusted..” 70 5.2 Continuing and stepping 70 3 Skipping Over Functions and Files 74 5.4 Signals ∴..76 5.5 Stopping and Starting Multi-thread Programs 5.5.1 All-Stop Mode.… 5.5. 2 Non-Stop Mode 81 5.5. 3 Background Execution 82 5.5.4 Thread-Specific Breakpoints............... 83 5.5.5 Interrupted Systeln calls ..83 5.5.6 Observer Mode 84 6 Running programs backward 87 7 Recording Inferior's Execution and Replaying It 89 8 Examining the Stack 97 8.1 Stack frames 鲁鲁, 97 8.2 Backtraces 98 8.3 Selecting a frame ..100 8. 4 Information About a frame l01 8.5 Management of frame Filters .102 9 Examining Source Files 105 9.1 Printing source lines 105 9.2 Specifying a Location · 106 9.2.1 Linespec Locations ,,,106 9.2.2 Explicit Locations...……,,,107 9.2.3 Address locations ,,108 9.3 Editing source files ...109 9.3. 1 Choosing your Editor 109 9.1 Scarching sourcc files 9.5 Specifying Source Directories ····· .110 9. 6 Source and machine code 113 10卫 examining Data.. 申·。·看D 119 10.1 Expressions ....12 10.2 Ambiguous Expressions 122 10.3 Program Varia bles 123 10.4 Artificial A 126 10.5 Output Formats 126 10.6 Examining Memory .128 10.7 Automatic Display 130 10.8 Print Settil 132 10.9 Pretty Printing ..140 10.9.1 Pretty-Printer Introduction 140 10.9.2 Pretty-Printer Example....... ·:· 141 10.9.3 Pretty-Printer Commands ..141 10.10 Value History.,,,,,,…,,1412 10.11 Convenience Variables ..143 10.12 Convenience functions ∴.,146 10.13 Registers 148 10.14 Floating point hardware..................150 10.15 Vector Unit .150 10.16 Opcrating System Auxiliary Information 150 10.17 Memory Region Attributes ................ 152 10.17.1 Attributes ..153 10.17.1 1 Memory Access Mode 153 10. 17.1.2 Memory Access Size ∴...154 10.17.1.3 Data Cache 154 10.17.2 Memory Access Checking 154 10.18 Copy Between Memory and a File 154 10. 19 How to Produce a Core File from Your Program...... 155 10.20 Character sets .156 10.21 Caching Data of Targets 鲁, 159 10.22 Search Memor ∴.,160 10.23 Value sizes 162 11 Debugging Optimized Code .163 11.1 Inline functions .,163 11.2 Tail Call Frames 164 Debugging with GDB 12 C Preprocessor Macros 167 13 Tracepoints 171 13.1 Commands to Set tracepoints 171 13.1.1 Create and Delete Tracepoints 172 13. 1.2 Enable and Disable Tracepoints 174 13.1.3 Tracepoint Passcounts 174 13.1.4 Tracepoint Conditions 175 13.1.5 Trace State Variables 17 13.1.6 Tracepoint Action Lists ..176 13. 1.7 Listing Tracepoints 178 13.1. 8 Listing Static Tracepoint Markers 179 13.1.9 Starting and Stopping Trace Ex] ts∴∴,180 13.1.10 Tracepoint restrictions .∴,,,182 13.2 Using the Collected Dala. ∴,183 13.2.1 tfind n. 183 13.2.2 thump... ,,,185 13.2.3 save tracepoints filename ..,186 13.3 Convenience Variables for Tracepoints ∴....186 3.4 USing 187 14 Debugging Programs That Use Overlays 189 14.1 How Overlays Work 189 14.2 Overlay Commands 190 14.3 Automatic Overlay Debugging 192 14.4 Overlay Sample program 193 15 Using GDB with Different Languages 195 15.1 Switching Bctwccn Sourcc Languages .195 15.1.1 List of Filename Extensions and Languages....... 195 15.1.2 Setting the Working language............. 196 15.1.3 Having GDB Infer the Source Language 196 15.2 Displaying the language ∴...196 15.3 Type and Range Checking 197 15.3.1 An Overview of Type Checking............ 197 15.3.2 An Overview of Range Checking 198 15.4 Supported languages 199 15.4.1 C and c++ 199 15.4.1.1 C and o++O 199 15.4.1.2 C and C++ Constants 201 15.4.1.3 C++ Expressions 02 15.1.1.1 C and c++ Defaults 203 15.4.1.5 C and C++ Type and range Checks 03 15.1.1.6 GDB and C ..203 15.4.1.7 GDB Features for c++ 203 15.4.1.8 Decimal Floating Point format ∴....205 15.4.2D 15.4.3Go. ∴......205 15.4.4 Objective-C .206 15.4.4.1 Method names in Commands ∴....,,206 15.4.4.2 The Print Command With Objective-C ∴..207 15.4.5 OpenCL C 207 15.4.5. 1 Open CL C Datatypes ∴.,,207 15.4.5.2 OpenCL C上 xpressIons.… 207 15.4.5. 3 OpenCL C operators 207 15.4.6 Fortran 207 15.4.6.1 Fortran Operators and Expressions. ...............208 15.4.6.2 Fortran Defaults 208 15.4.6.3 Special Fortran Commands 208 15.4.7 Pascal 208 15.4.8Rus 15.4.9 Modula-2 15.4.9.1 Operators 209 15.4.9.2 Built-in Functions and procedures 15.4.9.3 Constants 212 15.4.9. Modula-2 Types .212 15.4.9.5 Modula-2 Defaults 214 15.4.9.6 Deviations from Standard Modula-2 214 15.4.9.7 Modula-2 Type and Range Checks 214 15.498The Operators d 15.4.9.9 GDB and modula-2 15.4.10Ada.. 申鲁·鲁 21 15.4.10.1 Introduction...,,,.215 15.4.10.2 Omissions from Ada 216 15.4.10.4 Overloading support for Ada 15.1.10.3 Additions to Ada 217 ...219 15.1.10.5 Stopping at the very Beginning 219 15.4.10.6 Ada Exceptions 219 15.4. 10.7 Extensions for Ada Tasks 220 15.4. 10.8 Tasking Support when Debugging Core Files..... 223 15.4.10.9 Tasking Support when using thc R ar profile 223 15.4.10.10 Ada sct 223 15.4.10.11 Known peculiarities of ada e 224 15.5 Unsupported Language 225 16 Examining the Symbol Table 227 Debugging with GDB 17 Altering Execution 239 17.1 Assignment to Variables 239 17.2 Continuing at a Different Address 210 17. 3 Giving your Program a signal ∴.,241 17.1 Returning from a Function ..212 17.5. 1 Calling functions with no debug inIo,,,,,.,,......243 17.5 Calling Program Functions 244 17. 6 Patching programs 244 17.7 Compiling and injecting codc in GDB 17.7.1 Compilation options for the compile command..... 246 17.7.2 Caveats when using the compile command 247 17.7.3 Compiler search for the compile command....... 249 1 8 GDB Files 251 18.1 CoMmands to Specily Files 251 18.2上 ile caching ....,260 18.3 Debugging Information in Separate Files.......... 260 18.1 Debugging information in a special section 264 18.5 Index Files Speed up gdb 264 18.6 Errors Reading Symbol Files ∴.,265 18.7 GDB Data files 267 9 Specifying a Debugging target 269 19.1 Active Targe 269 19.2 Commands for Managing Targets .....269 19.3 Choosing Target Byte Order 20 Debugging Remote Programs 273 20.1 Connecting to a Remote Target 273 20.1.1 Types of Remote Connections 273 20.1.2 Host and Target Files ..274 20.1.3 Remote Connection Commands 275 20.2 Sending files to a remote system 276 20.3 USing the gdbserver Program 277 20.3.1 Running gdbserver 277 20.3.1.1 Attaching to a Running Program 278 20.3. 1.2 TCP port allocation lifecycle of gdbserver 20.3. 1.3 Other Command-Line Arguments for gdbserver.. 279 20.3.2 Connecting to gdbserver 280 20.3. 3 Monitor Commands for gdbserver 280 20.3. 4 Tracepoints support in gdbserver ..281 20.4 Remote Configuration 282 20.5 Implementing a Remote Stub 20.5.1 What the Stub Can Do for You ) 20.5.2 What You must Do for the Stub 290 20.5.3 Putting it All Together 291 VIl 21 Configuration-Specific Information 293 21.1 Native..... · 293 21.1.1 BSD libkvm Interface 93 21.1.2 Process information ∴..293 21.1.3 Features for Debugging DjCPP Programs 21.1.4 Features for Debugging Ms Windows PE Executables. 297 21.1.4.1 Support for DlLs without Debugging Symbols... 299 21.1.4.2 DLL Name prefixes .299 21.1.4.3 Working with Minimal Symbols ∴..,,300 21. 1.5 Commands specific to gnu Hurd systems.......300 21.1.6 Darwin..,,,,,, 303 21.2 Embedded Operating systems 303 21.3 Embedded processors ..303 21.3.1 Synopsys arc ..304 21.3.2ARM 304 21.3.3M68k. 305 21.3.4 Microblaze 305 21.3.5 MIPS Embedded ∴.,,,306 21.3.6 OpenRISC 1000 .306 21.3.7 PowerPC Embedded ........307 21.3.8 Atmel AVR ········ 308 21.3.9CRIS..,,, 308 21.3.10R Super-H 21.4 Architectures ..3 21.4.1 AArch64.. 21.4.1.1A4rch64SVE 309 21.4.2 x86 Architecture-specific Issues 21.4.2.1 Intcl Mcmory Protcction Extcnsions(MPX).... 310 21.4.3 Alpha 311 21.4.4MIPS ∴...311 21.4.5HPPA 313 21.4.6 Cell Broadband Engine SPU architecture........ 313 21.4.7 PowerPC ...314 21.4.8 Nios Ii 314 21.4.9 Sparc64 ...314 21.4.9.1 ADI Support 314 22 Controlling GDB 317 22.1 Prompt ...317 22.2 Command Editing 317 2.3 Command History .318 22.4 Screen size ..319 umbers 320 22.6 Configuring the Current ABT ....321 2.7 Automatically loading associatcd files .,322 22.7.1 Automatica ly loading init file in the current directorv. 324 22.7.2 Automatically loading thread debugging library.... 324 22.7. 3 Security restriction for auto-loading ..325 Debugging with GDB 22.7. 4 Displaying files tried for auto-load .326 2. 8 Optional Warnings and messages .....327 22.9 Optional messages about Internal happenings 328 22.10 Other Miscellaneous Settings .333 23 Extending GDB 335 23.1 Canned Sequences of Commands 335 23.1.1 Uscr-dcfincd Commands ..335 23.1.2 User-defined command hooks ....337 23. 1.3 Command Files.................... 338 23.1. 4 Commands for Controlled output 340 23.1.5 Controlling auto-loading native GDB scripts .341 23.2 Extending GDB using Python 342 23.2.1 Python Commands .·· ...342 23.2.2 Python API 343 23.2.2.1 Basic Python 343 23.2.2. 2 Exception Handling 347 23.2.2.3 Values from Inferior 348 23.2.2.4 Types In Python.………….353 23.2. 2.5 Pretty Printing API ..357 23.2.2.6 Selecting Pretty-Printers 358 23.2.2.7 Writing a Prelly-Printer 359 23 2.2.8 Type Printing API................361 23.2.2.9 Fillering Fralnes.................. 362 23.2.2.10 Decorating frames 364 23.2.2.11 Writing a Frame Filter ,,,,,,367 3.2.2. 12 Unwinding frames in Python 371 23.2.2.13 Xmethods In Python...............373 23. 2.2.14 Xmcthod API 374 23.2.2. 15 Writing an Xmethod .375 23.2.2.16 Inferiors In Python 378 23.2.2.17 Events In python ..379 23.2.2.18 Threads In python 383 23.2.2.19 Recordings In Python ....384 23.2.2. 20 Commands In Python 23.2.2. 21 Parameters In Python 391 23.2. 2.22 Writing new convenience functions 393 23.2.2.23 Program Spaces In Python ..394 23.2.2. 24 Objfiles In Python ∴,395 23.2. 2.25 Accessing inferior stack frames from Python...... 398 23.2.2.26 Accessing blocks from Python 401 23.2.2.27 Python representation of Symbols ∴......,102 23.2. 2.28 Symbol table representation in Python. 406 23.2.2. 29 Manipulating line tables using Python 107 23.2. 2.30 Manipulating breakpoints using PythON..... 408 23.2.2. 31 Finish Breakpoints ∴,411 23.2.2.32 Python representation of lazy strings 412 23.2.2.33 Python reprcscntation of architccturcs............ 413

...展开详情
2019-01-28 上传 大小:2.53MB
举报 收藏 (1)
分享