How can I run my program using valgrind directly in CLion using the run configuration ? I found how to add parameters when I launch my program, but how can I launch valgrind like :
valgrind my_program arg1 --arg2 ...
And how can I change easily the parameters without going on the "Edit configuration" panel to add, for example, valgrind options ?
Valgrind is installed on the department machines. To invoke it on an executable called a. out, you simply run the command valgrind ./a. out (with any arguments your program might need).
Valgrind is a multipurpose code profiling and memory debugging tool for Linux when on the x86 and, as of version 3, AMD64, architectures. It allows you to run your program in Valgrind's own environment that monitors memory usage such as calls to malloc and free (or new and delete in C++).
You could create a custom target in your CMakeLists.txt
that runs your program under valgrind.
Valgrind is now natively supported in CLion 2017.3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With