Debugging with GDB (September 2007)

v
14.10.8.1 Stop when freeing unallo c ated or
deallocated blocks . . . . . . . . . . . . . . . . . . . . . . . 146
14.10.8.2 Stop when freeing a blo ck if bad writes
occurred outside block boundary . . . . . . . . . . 146
14.10.8.3 Stop when a specified block address is
allocated or deallocated . . . . . . . . . . . . . . . . . . 147
14.10.8.4 Scramble previous memory contents at
malloc/free calls . . . . . . . . . . . . . . . . . . . . . . . . . 147
14.10.9 Comparison of Memory Debugging Commands in
Interactive Mode and Batch Mode . . . . . . . . . . . . . . . 147
14.10.10 Heap Profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
14.10.10.1 Commands for heap profiling . . . . . . 150
14.10.10.2 info heap arena . . . . . . . . . . . . . . . . . 150
14.10.10.3 info heap arena [0 |1|2|..] blocks
stacks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
14.10.10.4 info module ADDRESS . . . . . . . . . . . . . 151
14.10.10.5 info heap process . . . . . . . . . . . . . . . 151
14.10.10.6 Example for heap profiling. . . . . . . . . 151
14.10.11 Memory Checking Analysis for User Defined
Memory Management Routines . . . . . . . . . . . . . . . . . . 152
14.10.12 Commands to track the change in data segment
value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
14.11 Thread Debugging Supp ort . . . . . . . . . . . . . . . . . . . . . . . . . . 153
14.11.1 Support for Enabling and Disabling Specific
Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
14.11.2 Backtrace Support for Thread Debugging . . . . 154
14.11.3 Advanced Thread Debugging Supp ort . . . . . . . . 154
14.11.3.1 Pre-requisites for Advanced Thread
Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
14.11.3.2 Enabling and Disabling Advanced
Thread Debugging Features. . . . . . . . . . . . . . . 155
14.11.3.3 Commands to view information on
pthread primitives . . . . . . . . . . . . . . . . . . . . . . . 158
14.11.4 Debugging Threads Interactively After Attaching
to a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
14.12 Debugging MPI Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
14.13 Debugging multiple pro ce ss es ( programs with fork and
vfork calls) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
14.13.1 Ask mode for set follow-fork-mode . . . . . . . . 159
14.13.2 serial mode for set follow-fork-mode . . . . . . . 160
14.13.3 Support for showing unwind info. . . . . . . . . . . . . 160
14.13.4 Printing CFM and PFS registers. . . . . . . . . . . . . 161
14.14 Debugging Core Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
14.14.1 Generating core files with packcore
/unpackcore/getcore . . . . . . . . . . . . . . . . . . . . . . . . . . 161
14.14.2 Support for the dumpcore command . . . . . . . . . 162
14.14.2.1 Enhancements to the dump c ore
command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162