GDB Debug Output STL Container content (Ultimate solution) under Windows Eclipse

Source: Internet
Author: User
Tags gdb debugger

A day of groping and finally getting this problem fixed.


First download MinGW

Address: Http://sourceforge.net/projects/mingw/?source=directory

Install g++ after download, and follow the steps in the Setup program


Then use cmd to install Gdb-python

MinGw-get.exe install gdb-python
install GDB at the same time


Also follow these steps to install and configure Python

1) Download Python 2.7.x from http://python.org/download/

2) Setting Python environment variables

PYTHONPATH 应该是 C:\Python27\Lib (或者类似的) PYTHONHOME 应该是 C:\Python27
3) Add the Pythonhome to the path directory

 %PYTHONHOME%;...
4) Open the text editor and enter the following to save as. gdbinit files, and placed under the same path as Gdb-python27.exe, typically similar to this:C:\MinGW\bin\gdb-python27.exe

pythonImportSyssys.Path.Insert(0, ' C:/mingw/share/gcc-4.6.1/python ')#此目录是放置打印的python脚本的地方, typically under a similar directory from Libstdcxx.V6.PrintersImportregister_libstdcxx_printersregister_libstdcxx_printers(None)End
5) Turn on Eclipse to configure the MinGW as follows (if configured, ignore)

Http://jingyan.baidu.com/article/380abd0a5888211d90192cd6.html

6) Configure the GDB path with the. Gdbinit path

Open Window---preferences, C + +, Debug. GDB change to the right gdb debugger and gdb command file
Note that debugger must be gdb-python27.exe and not gdb.exe. Python will not be supported
Finally, it shows the following
Reference:
Http://wiki.eclipse.org/CDT/User/FAQ#CDT_does_not_recognize_C.2B.2B11_features
Http://stackoverflow.com/questions/21376381/debugging-stl-containers-using-mingw-issue-with-python-script
http://stackoverflow.com/questions/148281/eclipse-c-pretty-printing/14266862#14266862


GDB Debug Output STL Container content (Ultimate solution) under Windows Eclipse

Related Article

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.