From: shuai xi <aha...@gm...> - 2018-07-12 09:27:15
|
hello developer, i want to write a tool for valgrind to analysis an program automatically. I know that 'Memcheck's implementation of malloc has "nothing to do" with glibc's implementation' after readind some code of valgrind, but i want to use the glibc's malloc to avoid changing heap layout. Memcheck sets the VG_(needs_malloc_replacement) to hook malloc and exec MC_(malloc) instead of real malloc. It's very convenient. So can i get the address of the original malloc in MC_(malloc) and exec it? if not,can i use I_WRAP_SONAME_FNNAME_ZU function to hook malloc in my valgrind tool's code? thanks. |