Valgrind with dynamically linked GCC plugin

Suryansh Kumar suryansh.1234@gmail.com
Wed Jun 3 07:18:00 GMT 2015


I've been using the profiling tool valgrind for a while now. It
requires an executable to run, i.e.

    $    valgrind ./a.out

I want to use it on a dynamically linked GCC plugin, and list the time
taken and the number of calls by each function used in the plugin. I
am running the GCC plugin as follows:

    $    gcc -fplugin=./plugin.so myfile.c


When I run the following command, valgrind reports the memory leaks
for only gcc and not for plugin.so. I need a way to run valgrind
exclusively on my plugin, which is a .so file.

    $    valgrind gcc -fplugin=./plugin.so myfile.c

    $    gcc -fplugin=./plugin.so myfile.c -wrapper valgrind


Is it even possible to do that? I've searched up on this a lot but
haven't found any concrete answer on it.

Regards,
Suryansh D Kumar



More information about the Gcc-help mailing list