GDB formatted struct-body output

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.