Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: sipickles on November 27, 2007, 09:04:33 pm

Title: Using Valgrind with C::B
Post by: sipickles on November 27, 2007, 09:04:33 pm
Hi,

I am new to C++ dev on Linux so bear with me.

Can anyone advise me how to use the binary output by codeblocks with valgrind? Can it be used within CB?

And how can I run the app CB produces? At present I have to copy the command line from the Build log window to run it outside CB. Eg:
xterm -T zone -e /usr/bin/cb_console_runner /home/simon/Dev/zone_20071110/project/bin/Debug/zone_20071110

What is the cb_console_runner bit about? And why can I not do this:
xterm -T zone -e /home/simon/Dev/zone_20071110/project/bin/Debug/zone_20071110

I tried using Valgrind like this:
valgrind --leak-check=yes xterm -T zone -e /usr/bin/cb_console_runner /home/simon/Dev/zone_20071110/project/bin/Debug/zone_20071110

but I get an error:
valgrind: /usr/bin/xterm: Permission denied


Thanks!  :shock:
Title: Re: Using Valgrind with C::B
Post by: killerbot on November 27, 2007, 09:23:43 pm
see here : http://forums.codeblocks.org/index.php/topic,6666.0.html

currently it is not up to date for the latest CB SDK. But update will follow by the end of the week, or during the weekend.
Title: Re: Using Valgrind with C::B
Post by: sipickles on November 27, 2007, 10:47:34 pm
Ah, thanks KB that looks good.  One Q:

Its says I should be working on an executable project. I am producing a console app from the CB project wizard. Is this Okay?

I only ask because my output file from CB doesn't do anything on its own, I have to run it through a terminal and the cb_termianl_runner (which I still don't get!)
Title: Re: Using Valgrind with C::B
Post by: killerbot on November 27, 2007, 10:50:50 pm
console app is an executable

and a console app runs in an 'console' or 'shell'.

When you debug from within CB : Cb will start that console_runner.

The plug-in will startup valgrind and pass it your app (sort of ;-)  )
Title: Re: Using Valgrind with C::B
Post by: sipickles on November 28, 2007, 08:25:46 pm
Ah, my Linux skillz arent up to building CB from source yet.....