Memory Analysis in Eclipse CDT Linux

Source: Internet
Author: User
Tags valgrind

C ++ product development and online integration require Memory leakage, coverage rate, and other checks. These tools are good in Windows, such

Visual Studio:This has many built-in tools.

Devpartner:VC6 BoundChecker is great, Devpartner integrates a lot of feature set http://www.borland.com/products/devpartner/default.aspx

Insure ++: http://www.parasoft.com/jsp/products/insure.jsp? ItemId = 63

In the Linux environment, there are a lot fewer options. The following describes how to use the tools in eclipse, which is very difficult.

Environment

Ubuntu 10 64-bit

Eclipse Juno

Procedure

1,Eclipse CDT [http://www.eclipse.org/downloads/packages/eclipse-ide-cc-javass/keplerr#after installation, Linux tools [http://www.eclipse.org/linuxtools/index.php] are integrated with many built-in tools

However, an error is returned when it is used after startup.

java.lang.NullPointerException        at org.eclipse.linuxtools.internal.valgrind.core.ValgrindCommand.readIntoBuffer(ValgrindCommand.java:82)

Google, this problem still exists, but it has not been answered. I don't know how to solve it.

2,In this case, use it directly, go to the http://valgrind.org/download Installation

After testing a program according to the documents in the docs directory, an error message is displayed.

valgrind:  valgrind:    On Debian, Ubuntu:                 libc6-dbgvalgrind:    On SuSE, openSuSE, Fedora, RHEL:   glibc-debuginfo

The method in http://askubuntu.com/questions/148236/valgrind-does-debug-error is given.

Run the sudo apt-get install libc6-dbg and prompt E: A package error that cannot be installed
Find the following quick solution:
Sudo apt-get update; sudo aptitude install libc6-dbg
Ubuntu about aptitude and apt-get http://blog.csdn.net/yili_xie/article/details/4803314
I learned another trick when I used aptitude to solve the packet conflict problem.

3,Usage: After all the above are installed, it can be used properly.

Valgrind -- leak-check = yes./aa check a test program and it is finally normal.

Now you can go to Eclipse. For more information, see

At this time, you can intuitively see the leakage and prompt

In addition, Eclipse provides a series of other tools for C ++ to analyze the auxiliary code, such as the coverage rate.

 

Compared with these tools in Windows, configuration and use are troublesome.

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.