Record my GDB configurations

Source: Internet
Author: User

Record my GDB configurations
I. To better display the STL container in GDB, We need to download a python script first.
PS: Make sure that the GDB you installed can execute the python script.

Cd ~ Mkdir. gdbcd. gdbsvn co svn: // gcc.gnu.org/svn/gcc/trunk/libstdc##-v3/python


2. Modify the. gdbinit file in the user directory (copy the following text)

# The python script pythonimport sys executed to better display the STL container in GDB # qch is my username. You can modify sys according to your username. path. insert (0, '/home/qch /. gdb/python ') from libstdcxx. v6.printers import register_libstdcxx_printersregister_libstdcxx_printers (None) end # Open the array display, set print array on # Make GDB display the struct set print pretty on more beautifully # explicitly display the consortium Data set print union on # Let GDB follow the virtual Method the called rule displays the output set print object on

Success

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.