From: Nir T. <nir...@gm...> - 2009-11-29 08:20:25
|
Hello. I have been using valgrind for a very long time, and found it one of the best (if not The Best) debugging and bug finding tools ever. I have even ported applications from other archs to linux just to be able to run them through valgrind and track an elusive bug. However, there is one point where valgrind does not scratch my itch: reporting memory allocations. I have searched through the documentation, and did not find any way to report all the locations where memory is allocated. This is a main concern for many applications (think realtime) and is very hard to track in C++ code. I have been using a homebrew tool, based on LD_PRELOAD, to do just that, and then it struck me: why not add a valgrind tool? At the link below is a very crude implementation of a tool (which I named alloc) which does exactly this: http://www.cs.bgu.ac.il/~tzachar/code/alloc.tar.bz2 alloc reports memory allocations using the error reporting mechanisms of valgrind, and supports suppressions of specific errors using the core suppressions services. alloc also supports reporting errors starting after a predetermined number of allocations have occurred (for example, after all of the memory pools used by the program have been filled). I would really like to see this tool, or some kind of an equivalent tool (probably added to memcheck?), added to the default valgrind branch. I would also like to hear your opinions, comments and suggestions. Cheers, Nir. |