|
From: Nicholas N. <nj...@ca...> - 2003-10-20 10:20:22
|
On Sun, 19 Oct 2003 aho...@es... wrote:
> I would like to have valgrind's --trace-malloc option also
> print out the debugging info at that location (function
> name, line number, etc). Is there an easy way to do that, or
> do I need to hack vg_replace_malloc.c?
Hacking is required. Don't do it in vg_replace_malloc.c, but in
memcheck/mac_malloc_wrappers.c. For each alloc/free function you're
interested in (eg. SK_(malloc)(), SK_(free)(), etc), add this to it:
if (VG_(clo_trace_malloc)) {
VG_(printf)("\n");
VG_(pp_ExeContext)(
VG_(get_ExeContext)(
VG_(get_current_or_recent_tid)() ) );
}
Hope this helps.
N
|