News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Valgrind plugin

Started by killerbot, August 12, 2007, 08:57:04 PM

Previous topic - Next topic

DrPatrock

Hello,

I'm using Codeblocks together with CMake (Unix Makefile Generator). With these external Makefiles there are no compiler options per target. In the Makefiles i have the -g option enabled but when i try to start valgrind, it complains about the  missing -g option... Is there a workaround for this problem ?? Where does valgrind look for this option ?

THX & Greets
Patrock

killerbot

It looks at the codeblocks project, at the actual target (.cbp file). It doesn't work with external makefiles.

Jenna

There is a workaround:

uncheck the "This is a custom makefile" check-box in the projects properties,
close the properties dialog (don't use the build-options button at the bottom),
open the build-options,
check the "Produce debugging symbols" checkbox in the "compiler flags" tab,
switch back to the properties,
check "This is a custom makefile" again.

Works for me here.

DrPatrock

thanks Jens...

It's working for me too now...


Dikei

Quote
valgrind --version
valgrind-3.5.0-Debian
valgrind --leak-check=yes --xml=yes "bin/Debug/Bai4"
==8013== --xml=yes has been specified, but there is no XML output
==8013== destination.  You must specify an XML output destination
==8013== using --xml-fd=, --xml-file= or --xml=socket=.
valgrind: Bad option '--xml=yes, but no XML destination specified'; aborting.
valgrind: Use --help for more information.

The Valgrind plugin keeps failing with the error message above.
I'm using codeblock svn 5911 on Ubuntu 9.10

killerbot

Thanks for reporting, I will fix this. It seems the new Valgrind wants an xml file to be specified.

killerbot

alright I know what to do.

Off course the fun is i will have to check valgrind versions since the changes valgrind has are not backwards compatible.

Old command :
valgrind --leak-check=yes --xml=yes ./DeleteMe

New command :
valgrind --leak-check=yes --xml=yes --xml-file=test.xml ./DeleteMe

Unfortunately the option 'xml-file=test.xml' will be flagged as an error by the old valgrind (valgrind: Bad option '--xml-file=test.xml'; aborting.).

Will start working on it soon.

oBFusCATed

Why not use:

valgrind --leak-check=yes --xml=yes --xml-fd=1 ./test_cb_stl_debug


--xml-fd=1 -> should mean use file that is the standard output
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

killerbot

could work too, yes.
But the special version check logic will be needed, since also this will cause an error on pre 3.5.0 versions of valgrind.

But I think, putting it in a real file will be better, that way regular program output on stdout can not mix with the xml output parts.

Have already coded the change, test session should be carried out tomorrow.

oBFusCATed

C::B project - debugger branch:

Valgrind -> Run Valgrind::MemCheck says:
"You need to have an (executable) target in your open project before using the plugin!"

I've tried  targets: "All" and "src"
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Sqeaky

QuoteThere is a workaround:

uncheck the "This is a custom makefile" check-box in the projects properties,
close the properties dialog (don't use the build-options button at the bottom),
open the build-options,
check the "Produce debugging symbols" checkbox in the "compiler flags" tab,
switch back to the properties,
check "This is a custom makefile" again.

Works for me here.

I have a project that uses cmake to create Makefiles, and this did not work for me. Where is the source for for the valgrind plugin? I bet I could make it skip this check if a custom makefile is used.

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Sqeaky

#42
Thanks I am checking it out now.


Edit, I got the the source for it, and I will dig in in the next few days, it doesn't seem like this plugin is really a high priority for anyone else (because it seems to work most of the time) , so I will take my time.