|
From: Alexander P. <gl...@go...> - 2009-10-01 15:37:15
|
Hi everyone,
It appears that the suppressions generated by Valgrind on Mac OS
contain function names with the gcc mangling scheme (ok for Linux, but
invalid for Mac OS).
For example, for the following code:
-------------------------
#include <stdio.h>
struct Foo {
void bar() {
int *a = new int;
*a = 12345;
delete a;
a = new int;
if (*a == 12345) printf("67890\n");
}
};
int main() {
Foo foo;
foo.bar();
return 0;
}
-------------------------
valgrind --gen-suppressions=all produces the following suppression:
-------------------------
{
<insert_a_suppression_name_here>
Memcheck:Cond
fun:_ZN3Foo3barEv
fun:main
}
-------------------------
This suppression really works on Mac OS, but _ZN3Foo3barEv can't be
demangled with c++filt on this platform (it should be
"__ZN3Foo3barEv")
The question is: is it the bug or a feature? Do the suppressions on
every platform rely on the same mangling algorithm?
Thanks,
Alexander Potapenko
Software Engineer
Google Moscow
|