How do you tell Valgrind to completely suppress a particular .so file?

后端 未结 3 1224
野趣味
野趣味 2020-12-05 02:32

I\'m trying to use Valgrind on a program that I\'m working on, but Valgrind generates a bunch of errors for one of the libraries that I\'m using. I\'d like to be able to tel

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-05 03:02

    For most of the suppression types, you omit the wildcard, like so:

    {
       name
       Memcheck:Cond
       obj:/path/to/lib/lib.so.10.1
    }
    
    {
       name
       Memcheck:Free
       obj:/path/to/lib/lib.so.10.1
    }
    
    {
       name
       Memcheck:Value8
       obj:/path/to/lib/lib.so.10.1
    }
    

    Note that you must list each type of error separately, you can't wildcard them. You must also list the entire pathname of the library (as shown by valgrind, with any "decorations" like version numbers).

    Also, leaks are handled differently -- for those you need something that looks like this:

    {
       name
       Memcheck:Leak
       fun:*alloc
       ...
       obj:/path/to/lib/lib.so.10.1
       ...
    }
    

提交回复
热议问题