Author Topic: Valgrind plugin  (Read 49708 times)

Offline DrPatrock

  • Single posting newcomer
  • *
  • Posts: 4
Re: Valgrind plugin
« Reply #30 on: November 27, 2009, 12:34:35 pm »
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

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Valgrind plugin
« Reply #31 on: November 27, 2009, 06:12:40 pm »
It looks at the codeblocks project, at the actual target (.cbp file). It doesn't work with external makefiles.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Valgrind plugin
« Reply #32 on: November 27, 2009, 07:39:09 pm »
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.

Offline DrPatrock

  • Single posting newcomer
  • *
  • Posts: 4
Re: Valgrind plugin
« Reply #33 on: December 02, 2009, 11:32:29 am »
thanks Jens...

It's working for me too now...


Offline Dikei

  • Single posting newcomer
  • *
  • Posts: 2
Re: Valgrind plugin
« Reply #34 on: January 01, 2010, 04:59:25 am »
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

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Valgrind plugin
« Reply #35 on: January 01, 2010, 09:22:33 am »
Thanks for reporting, I will fix this. It seems the new Valgrind wants an xml file to be specified.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Valgrind plugin
« Reply #36 on: January 01, 2010, 12:56:19 pm »
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 :
Code
valgrind --leak-check=yes --xml=yes ./DeleteMe

New command :
Code
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Valgrind plugin
« Reply #37 on: January 01, 2010, 09:56:31 pm »
Why not use:
Code
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!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Valgrind plugin
« Reply #38 on: January 01, 2010, 10:57:41 pm »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Valgrind plugin
« Reply #39 on: May 06, 2010, 04:32:58 am »
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!]

Offline Sqeaky

  • Single posting newcomer
  • *
  • Posts: 8
Re: Valgrind plugin
« Reply #40 on: December 19, 2010, 11:39:40 pm »
Quote
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.

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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Valgrind plugin
« Reply #41 on: December 20, 2010, 01:39:43 am »
(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!]

Offline Sqeaky

  • Single posting newcomer
  • *
  • Posts: 8
Re: Valgrind plugin
« Reply #42 on: December 22, 2010, 06:43:37 pm »
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.
« Last Edit: December 22, 2010, 07:11:39 pm by Sqeaky »