Reprint: http://blog.csdn.net/unix21/article/details/9991925
Set Print Address
Set Print address on
Open address output, when the program displays the function information, GDB will show the function's parameter address. The system is turned on by default,
Show print Address
See if the current address display option is turned on.
Set Print array
Set Print array on
Open the array display, open when the array is displayed, each element occupies a row, if not open, each element is separated by commas. This option is off by default. The two commands associated with it are as follows, and I will not say more.
Set Print array off
Show Print Array
Set Print elements
This option is mainly set to the array, if your array is too large, then you can specify one to specify the maximum length of the data display, when the length is reached, GDB will not show down. If set to 0, no limit is expressed.
Show print elements
View option information for print elements.
Set Print Null-stop
If this option is turned on, a terminator is stopped when the string is displayed. This option is off by default.
Set Print pretty on
If you turn on printf pretty this option, it will be pretty when GDB displays the struct body.
------------------------------------------------
Controlling GDB
Set gdb-option value
Sets the options for GDB.
Set Print array on
Set Print array off
Show Print Array
Prints an array in readable form. The default is off.
Set Print array-indexes on
Set Print array-indexes off
Show Print Array-indexes
Prints the subscript of an array element. The default is off.
Set Print pretty on
Set print pretty off
Show Print Pretty
Formats the output of the C-struct body.
Set Print Union on
Set Print union off
Show Print Union
Print a union in C. The default is on.
-----------------Output File-----------------------------------------
1, # (GDB) Set logging file < file name >
Set the file name of the output
2, # (GDB) set logging on
After you enter this command, the debug information is then output to the specified file
3, # (GDB) thread apply all BT
Print said thread stack information
4, # (GDB) set logging off
Enter this command to close the output to the specified file
GDB formatted struct-body output