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

Using Valgrind with C::B

Started by sipickles, November 27, 2007, 09:04:33 PM

Previous topic - Next topic

sipickles

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:

killerbot

see here : http://forums.next.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.

sipickles

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!)

killerbot

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 ;-)  )

sipickles

Ah, my Linux skillz arent up to building CB from source yet.....