|
From: Alexander P. <gl...@go...> - 2009-07-22 15:42:56
|
Isn't wrapping *alloc/free and new/delete enough for that (i.e. can you recompile all the allocators you need)? If yes, it's possible not to use Valgrind at all. You can also edit memcheck/mc_malloc_wrappers.c to add the necessary functionality to Memcheck, I think. Alex On Wed, Jul 22, 2009 at 7:27 PM, Ivan Ivanov<bar...@gm...> wrote: > Hi, > > I wonder whether it is possible to rack the memory allocation/deallocation > in my application and all linked libraries by using Valgrind ? What do I > mean by that: I'd like to turn on some log that would write a memory > allocation in the following form: address, source file, source line of where > the allocation occurred (using C++ "new" operator, malloc, etc.). The same > is for deallocation (when using C++ "delete" operator, free, etc.). > Just in case: the purpose why I need that is that I'd like to quickly find > the source line where the allocation (and possible deallocation if this is a > dangling pointer) of memory for some problematic object occurred. The point > is when there are a lot of unfamiliar code and you quickly need to find a > problem (the point where the object was created could really help), that > would be really good thing. > So is that (or at least anything close to what I need) possible using > Valgrind ? > Thanks > ------------------------------------------------------------------------------ > > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > > -- WBR, Alexander Potapenko Software Engineer Google Moscow |